Crouching Player

Hi All,

My Playerbody consists of 2 circleshapes, one on the other. In the game, the Player should be able to crouch or slide. if he crouches the body have to get smaller. How can i realise that?

Thanks!
If you consider the bottom circle to be the legs, then connect the two with a prismatic joint and adjust the motor to make them come together when you want to crouch and go away from each other when you want to stand.

I've never actually used a prismatic joint but it's my understanding that it always maintains a direction relative to the world, not its bodies, so the player shouldn't fall over on you. Please someone correct me if I'm wrong.

Original thread: https://box2d.org/forum/viewtopic.php?t=6614