Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm making a game for Android with AndEngine.

It's going quite well, but now I'm stuck on something. My main character has a elasticity set in its fixturedef so it bounces around throughout the game. Now i want the user to be able to not let the player bounce when he does a control.

So my question: how can I modify the elasticity of my character? Because I saw you can adjust the setDensity and setFriction, but I cant see the setElasticity....

Thanks in advance!

share|improve this question
I also up vote your question because I also have to search for this thing. – Siddharth Jun 9 '13 at 4:11
up vote 1 down vote accepted

Following way you can change the restitution or elasticity of any body in box2d.

ArrayList<Fixture> fixtureList = body.getFixtureList();
    for (Fixture fixture : fixtureList)
share|improve this answer

This is because elasticity is expressed as a coeficient of restitution. Look for setRestitution (float restitution).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.