Work out how long it will take gravity to kill a force

What I am trying to do is work out how long it will take an object to reach its top position when a force is applied…

for example when i apply a force of Vector3(0f, 3.5f, 0f) how long will it take for the ball to stop moving up wards and then fall. (and also what its top position would be)

i need to work this out before the force is applied. I was expecting something like

float updatesBeforeForceNil = 3.5f / Physics.gravity.y;

but then the gravity setting is 9.81f! so that obviously wont work. I then thought that the gravity.y was how much force is removed per second, but i did some math and the numbers were close, but not quite there.

Even though I could have put this down to fluctuating frame rate, I don’t want to as it was based on a guess and probably completely wrong! I would rather get some advice of someone who has more experience! :slight_smile:

Thanks in advance

EDIT: I’m guessing this may also depend on which force type is used. (currently impulse);
also the calculation will always be from a stationary object!

Your math is correct, as long as you use velocity (it does take 3.5/9.8 seconds for gravity to kill an up speed of 3.5M/s.) If you checked the object’s velocity.y just after you gave it a force, the equation should work.

Look at it this way: if you apply a force to various objects, lighter ones will take longer to come back down than heavier ones. So, there’s no possible way to figure out force vs. gravity without knowing how heavy the object was. As soon as you apply the force, it’s auto-divided by [edit: XXgravityXX → mass] (and a constant?) to become velocity. You’ve now taking weight into account, so the math can work.