# How to get amount of force necessary stop object ?

If F=ma then I should add force that equals to mass multiplied by gravitational constant to freeze object in the air, right ?
By default my object (of mass 800) goes up because some amount of force applied, but then I want it to stop (on button click) by setting speed to ma, i.e. 800*9.832f. But it still does up slowly.
I use this to move it up or stop it:

Do you want some kind of âinstantaneousâ stop ?
If the answer is yes, you could just reset the velocity (donât forget angular velocity) and

• either keep applying the exact opposite force of the one thatâs pushing it up
• or disable gravity afterwards

You could also set isKinematic to true or remove the rigidbody completely and add attach a new one laterâŚ

There are pros and cons for any of these solutions.

I need to stop it gently - it doesnât matter now. I wanât to understand why F=ma doesnât work.

This moves object up:

``````void FixedUpdate () {
}
``````

This supposed to stop it on button click (I know this method is being called for sure):

``````void Stop()
{
vertThrust = 800*9.832f;

}
``````

The default gravity value in Unity is -9.81exactly. Have you changed that? If not, your calculation with a personal gravity constant will overcome Unityâs gravity [800 x 9.832 = 7865.6 > 800 x 9.81 = 7848].

If you use Physics.gravity.y in your calculation, barring floating point issues, it should zero out.

print(Physics.gravity.y ) gives -9.81. I tried 800*Physics.gravity.y - now it falls down.
What about barring floating point issues ?

Well if itâs rocketing straight down itâs because you need to negate the gravity value in your calculation, since itâs -9.81 not positive 9.81.

``````vertThrust = 800f * (-Physics.gravity.y);
``````

If itâs just barely creeping down, itâs probably a floating point issue or an order of operations issue.

I tried that - it just goes up with no visible change.

Thatâs physically correct, since you âaddâ forces which results in some kind of acceleration. If you eliminate all forces by zero-ing them out, there will be no force that affects the object. Hence it keeps its current velocity.

If you want to slow it down when itâs being pushed upwards, youâll need to apply a down-force thatâs higher than the force which is pushing up. Only then the object can slow down.

1 Like

It seems you right, object slows down at a moment when I applying down-force, I should work it out. Thanks.

But still, thatâs strange of Unity. If we consider VTOL (like F-35): it is necessary to apply some force to keep the plane soar at constant altitude - force that counterbalances gravity.