- Home /
Rigid body enemy
Hello, I am coding a rigid body based enemy but it moves by applying forces and I wanted to make it run in a fixed velocity, is that a way to do it? move it without apply forces and make it still collide just like character controller? (I dont wanna use character controller).
Thanks!
Answer by Nemox · Jun 10, 2011 at 07:22 AM
To move at a constant velocity, add the force of desiredDirection * (topSpeed - velocity.magnitude).
If you want to accelerate to a top speed, clamp that multiplied value to an Acceleration value.
Also, look up various ForceModes to determine which one is right for you.
Your answer
![](https://koobas.hobune.stream/wayback/20220612102329im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Rigidbody enemy Forcemode.VelocityChange 1 Answer
Enemy AI and Rigid Bodies 0 Answers
Freezing Rigidbody Rotation 1 Answer
Constant velocity -> weird physics interaction 1 Answer
Help fixing AI? 1 Answer