I have been working on a game with cars but they go to infinite speeds, and that's not nice.
I have no idea how to do it I tried rb.speed and stuff but I don't know how.
I have been working on a game with cars but they go to infinite speeds, and that's not nice.
I have no idea how to do it I tried rb.speed and stuff but I don't know how.
After saving rigidbody and defining a variable for speed limit, just limit it with Vector3.ClampMagnitude.
public float maxVelocity;
void FixedUpdate()
{
///... Add force
rb.velocity = Vector3.ClampMagnitude(rb.velocity, maxVelocity);
}