Change density of the body dynamically

Posted by Siddharth on Game Development See other posts from Game Development or by Siddharth
Published on 2012-06-13T09:30:44Z Indexed on 2012/06/13 10:48 UTC
Read the original article Hit count: 169

Filed under:

In my game, I want to change density of my body object when it collide with other objects. I found something like following to change density but further I could not able to find any hint for this. So someone please help.

Fixture fixture = goldenBoxArrayList.get(i)
                                        .getGoldenBoxBody()
                                        .getFixtureList().get(0);
                                fixture.setDensity(0.5f);

After setting fixture data I could not able to set it to the body.

© Game Development or respective owner

Related posts about andengine