Hi all. Been stuck solving this problem for a week now, and thought I’d try you guys.
Basicallly I want to create a rigidbody controller that responds to both player input and forces from other rigidbodies (ie. from player movement, and collision with other gameobjects, speeding the player up).
I’ve tried several methods, all which were successful in limiting the player velocity. Examples of them were clamping the velocity to maxSpeed, and adding a force opposite to the force added, if the player exceeds maxSpeed.
The problem with these methods is that they limit maxSpeed from player input and also from external forces. So when another (fast-moving) rigidbody collides with the player, the player doesn’t “fly off” as fast because of the maxSpeed limiting the player velocity.
I’m looking for a way to limit only the velocity caused by player input, and leave external forces be. Is there a way to do this?
Any help is appreciated. Thank you!