just to the main problem, since in box2d the object will automatically drop to the bottom (red arrow), then i want to create my object flying and stay with the same height (the green one). like this image.

and here is my code that i got from some web:
my object is fly but its fly away and never come back like a rocket.
i modified the code like this :
but its still fly to up slowly..
any one can help?

and here is my code that i got from some web:
Code:
gravityOffset.Multiply(-body.GetMass());
body.ApplyForce(gravityOffset, body.GetWorldCenter());
body.ApplyForce(gravityOffset, body.GetWorldCenter());
my object is fly but its fly away and never come back like a rocket.
i modified the code like this :
Code:
gravityOffset.x = 0;
gravityOffset.y = 0;
body.ApplyForce(gravityOffset, body.GetWorldCenter());
gravityOffset.y = 0;
body.ApplyForce(gravityOffset, body.GetWorldCenter());
but its still fly to up slowly..
any one can help?