I have a rigidbody and I want to limit its moving speed without affecting the rotation speed.
I tried to use:
Vector3 velocity = MainRigidbody.velocity;
if (velocity.magnitude > MaximumVelocity)
{
MainRigidbody.velocity(velocity.normalized * MaximumVelocity);
}
This does cap the moving speed but also caps the rotating speed. Is there a way to only alter the moving speed? It seems that velocity is the moving speed + the angularVelocity.