How do you limit velocity on a rigid body in only one direction? Or even better, different directions having different limits.
I saw Limiting rigidbody velocity - Unity Answers but I don’t think I can apply it to what I’m trying to do.
How do you limit velocity on a rigid body in only one direction? Or even better, different directions having different limits.
I saw Limiting rigidbody velocity - Unity Answers but I don’t think I can apply it to what I’m trying to do.
//limits movement along the vertical up direction by maxvelocity
if (CurrentDirection == transform.up)
{
if(rigidbody.velocity > MaxVelocity)
{
rigidbody.velocity = MaxVelocity;
}
}