Character stoping distance math

Here is a Tutorial to how to make a wheeled vehicle in Unreal.

In reality vehicle experience 2 types of meaningful friction (static and dynamic) and materials have different friction coefficients for those cases. Here is a Wikipedia article for more information on the physics side of things. Keep in mind that all those calculations already simulated in the Unreal physics engine.

In short:

FrictionForce = FrictionCoefficient * NormalForce

but also

FrictionForce = ObjectMass * FrictionDeceleration

so

FrictionDeceleration = FrictionCoefficient * NormalForce / ObjectMass

from this point on you get

StopTime = Speed / FrictionDeceleration
StopDistance = Speed * StopTime / 2

Keep in mind that the Friction Coefficient must be different when the car is sliding. (Above some maximum FrictionForce the coefficient changes) NormalForce is largely dependent on your car weight and the downforce.

If you need a full physical model of a car you will need to account for the downforce, suspension hardness, loss of friction, weight transfer between wheels, centrifugal force in turns, contact surface temperature and area (between the wheels and the road).

Some of these can and are frequently ignored in games. (temperature and weight transfer) Most of the ones that are needed (like loss of friction and down force) have simplified math models that are used in games but they are in no way simple to understand.

Happy coding :slight_smile: