Question by
Calneideck · Oct 28, 2016 at 02:01 PM ·
movementphysicsrigidbodyknockback
Knockback with limited movement
So a commonly asked question is how to limit a rigidbody's speed when using addForce. The common answer is something like:
if (rigidbody.velocity.maginitude > maxSpeed)
rigidbody.velocity = rigidbody.velocity.normalized * maxSpeed
But what if the rigidbody is also being hit with external forces like an explosion that doubles the max velocity? As soon as the player moves again the velocity will be set to the max. Is there a way to have both knockback and a movement speed limit?
Comment
Your answer
Follow this Question
Related Questions
Rigidbody sticks to wall 0 Answers
Rigidbody bouncing off other rigidbodies 0 Answers
How to fix this problem? 1 Answer
Character bounces off walls, and drops to the ground on movement 1 Answer
how to dostraight ball throwing objects from returning? 0 Answers