Max Velocity

Here's how to cap velocity of a physics object. The idea here is to get the object's velocity, normalize it, then scale it back, but no more than the max, and finally set the object's velocity to the new value.