is there a way to make a body able so that it don't use the gravity of the current space.
thanks
A fast, easy to use, free, and community supported 2D game engine
is there a way to make a body able so that it don't use the gravity of the current space.
thanks
Static or no mass?
The body that i added is not static.
Do you mean that it should have no mass like cpBodySetMass(ObjectBody, 0); .. ?
In this way the position of the body become NaN and added object disappears.
you could add an updwards force equivalent to gravity each time step...not sure if that would work? If you want it it be dynamic in other ways I dont think you can set zero mass.
It doesn't even need to be each time step (unless you call resetForces somewhere).
One time call:
cpBodyApplyForce(body, cpvmult(space->gravity, -cpBodyGetMass(body)), cpvzero);
[Edit] - btw, don't set the mass to zero
@mobilebros thanks
this works
You must log in to post.