- Home /
How do I stop my character from moving in a circle upon destination arrival?
So this is an issue that has an answer but that answer itself is a problem with the Unity Engine.
I'm using a mouse control script, and everything works except when I click on a point, the character walks to the point and starts rotating around the area I clicked. The Character Controller radius is .5, and the height is 2, but only way I was able to fix this was changing Step Offset to 6.5 or higher. This ends up in a critical error since Unity wants it to be 5 or less. I should also note that changing the radius and height so 6.5 should work brings the problem back to square 1, and I'll need to enter a higher, invalid offset for the character to stop rotating.
I've made and linked a video showing the problem in action, with the proper Step Offset and the working Step Offset: https://youtu.be/0_aR__qd2fs; hopefully this provides enough content to warrant a solution.
Just in case, the script can be found here: https://pastebin.com/Sen61tsB.
Thanks in advance.
Answer by Topthink · Jun 05, 2018 at 10:13 PM
A number of ways exist to do this. Perhaps most simple is to set your agent's speed to zero (NavMeshAgent) when he gets within range of his destination. That may work depending on your other code as well as other factors you may have in place. I just glanced at your code for a moment but if that doesn't work let me know and I'll take another more in depth look at what you have. Good Luck !!!
Your answer
![](https://koobas.hobune.stream/wayback/20220612164156im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Dampening Movement while in the Air 0 Answers
Left and right is inverted when moving! 2 Answers
2D player keeps getting dragged to the left for some reason. 0 Answers
Can you help with the character controller 1 Answer
Implementing Counter-Movement 0 Answers