- Home /
calculate the estimated distance travel based on the Force applied to Rigid Body
Hello everyone, How can I calculate the estimate the distance travel if I applied some amount of Force onto to Rigid Body with the mass of 1.
rigidbody.AddForce(transform.forward * Force, ForceMode.Impulse);
if I know the start position of this rigid body, what will be the final distance.. How can I calclate that.. and Viceversa.. how can I know that How much force that I have to apply to reach to the certain distance..
Anyone help me..
Answer by Herman-Tulleken · Oct 04, 2010 at 08:19 AM
In the absence of drag your object should travel on forever, the impulse amount will just change the speed.
If there is drag, you will need to know the equations that the engine uses for its calculations to calculate the distance the object will travel. I don't know if these are available.
But you should be able to do an experiment to determine which force to apply. Just run the game and apply different impulses (500N, 1000N, etc.) each time. Measure the object's initial and final positions, and log out the magnitude of the difference. (The easiest way to measure that final position is to make a function call on keypress, then you just watch until your object is still enough, and push the key to take the measurement.)
Now put the results in Excel or Calc, draw a graph, and you should be able to determine the force to apply. Keep the graph for reference later, and make sure to record the mass and drag of the object, as these factors will of course influence the results.
Thanks.. $$anonymous$$y rigidbody use gravity and it also has drag value too although I just assign the drag value to 1 and mass to 1.... I will try to keep record and based on the result, I will make a new equation...