Page 1 of 1

Floating stuff

Posted: Sun Feb 03, 2013 11:37 am
by kcid42
I am making a game with floating stuff. Because other non-floating stuff can stand on the stuff, i do not know the weight of the sum of objects. How can i make the floating stuff come to rest at a constant position, even with gravity and other objects standing on it?

My first idea would be to counter the gravity with an impuls based on the speed of the object, but then you are always a round too late, and the object will swerve around its original origin.

Re: Floating stuff

Posted: Sun Feb 03, 2013 1:14 pm
by iforce2d
Yes, applying an impulse or force is one way. You would have to check the position every time step to know what impulse to apply, but I don't think being one step behind would be a problem - it would have to be done gradually anyway.

I'm assuming you mean floating like in water, but if you are talking about floating platforms, you might be able to use the motor joint, which was made for that kind of situation.