Hello everyone. Hopefully someone can help me with this issue. I am using a basic vehicle script by Andrew Gotow for a vehicle I’m testing out in Unity. I need to find a way to cap off the vehicle’s maximum speed. Within Andrew’s script he does have a line commented as such:
// This is to limith the maximum speed of the car, adjusting the drag probably isn’t the best way of doing it,
// but it’s easy, and it doesn’t interfere with the physics processing.
rigidbody.drag = rigidbody.velocity.magnitude / 150;
However this doesn’t seem to have any impact on the speed of the car in my scene…my question is: Is there a better, more efficient way of capping the vehicle’s max speed…maybe an exposed variable in the editor I can set?