Remove gravity from single body
- by Siddharth
I have multiple bodies in my game world in andengine. All the bodies affected by gravity but in that I want my specific body does not affected by the gravity.
For that solution after research I found that I have to use
body.setGravityScale(0)
method for my problem solution.
But in my andengine extension I don't found that method so please provide guidance about how get access about that method.
Also for the above problem any other guidance will be acceptable. Thank You!
I apply following code for reverse gravity
final Vector2 vec = new Vector2(0, -SensorManager.GRAVITY_EARTH
* bulletBody.getMass());
bulletBody.applyForce(vec, bulletBody.getWorldCenter());