I have the following situation in my app created in AndEngine: sprites with attached Box2D bodies, appear and fall to the ground because of the introduced gravity.
The first object falls properly to the ground. The second object falls on the first object - which is OK, but if I move it right, it does not fall to the ground but hangs in the air. (I have attached touch handler so that I can move the object with my finger).
Basically sometimes after the collision the 2nd objects kind of gains some invisible margin at its bottom. Anyone has spotted this situation and can give me a hint please?
i just debugget it, all the objects have the fixture I set at the start (density 5, or 1 - it doesn't matter, elasticity 0, friction 1).

0
votes
2 Answers
1
votes
I have some knowledge regarding this situation. First you have to create physics world as per the following way.
mPhysicsWorld = new PhysicsWorld(new Vector2(0,SensorManager.GRAVITY_EARTH),false);
Here, in the above example last parameter is allowSleep value. In which you have to pass false so that any box2d bodies do not sleep.
And another situation, if you moving body which was attached with sprite then provide proper velocity to move object not perform transformation of body.