Hopefully I'm understanding your question. Are you wanting to make the player teeter when they are near the edge of the platform? Like they are about to fall? If so, first you make a teeter animation, then make some invisible sprite and pin it to your player. Use that sprite to detect when they are near the edge of a platform. When they are, play the teeter animation. If you want something else then please explain further.