What's the method to use to detect how much force is needed to bring a rigidbody's velocity to zero on a given FixedUpdate()?
Here's the context of my question:
I'm creating a raycast car using a rigidbody applied to the car's body, and four raycasts to programatically create the tire/suspension sytems.
Currently I'm stuck trying to programatically add tire friction into the system. For now I'm just assuming all 4 tires are locked up so the car is effectively skidding on 4 rubber pads.
I know how to get the velocity vector of each tire tangent to the surface it's skidding on, so it's trivial enough to appply a force to the car's rigidbody in the opposite direction using AddForceAtPosition(). My problem is that as the velocity of the car is slowed down by this friction force, at some point that friction force is too strong in relation to the velocity it's opposing and it pushes the car in the opposite direction (instead of just stopping it perfectly).
Therefore, before applying the friction force each FixedUpdate(), I need to check to see if it exceeds the force required to bring the rigidbody to a standstill, and if it does, apply that force instead.