- Home /
Nav Mesh Agent break between Rotation changes
Is it possible to make a Nav Mesh agent only walk straight paths and stop a certain amount of time every time he changes rotation to walk into a different direction?
Please give more information on what you are trying to achieve. It is a bit unclear what you mean by this. $$anonymous$$aybe what you need is not a NavmeshAgent, but an CharacterController?
If the path the NavmeshAgent is taking includes going into several different directions (not just a straight path towards the target) i want it to stop for a few seconds after each straight path it went. For example if the NavmeshAgent has a route that says move 10 units forward and then 5 units right(because a obstacle is in the way) i want it to stop after moving the 10 secs and then continue/or completely stop
Answer by Harinezumi · Feb 13, 2018 at 09:32 AM
You can get the points where the NavmeshAgent will turn either directly with NavMeshAgent.steeringTarget or first getting the NavMeshAgent.path and then the corners. Then you should monitor the movement of the agent (probably in a coroutine), set the angularSpeed to 0, and whenever it gets close to a corner set the velocity to 0 as well until the waiting time passes. Then you first allow it to turn by setting a higher angular speed, and when that is done, you allow the velocity again. Repeat until target is reached or path becomes invalid.
I hope this helps, please respond with your solution if you succeed with it!
Thanks I'll give it a shot and Update as soon as i manage to do this.
Your answer
Follow this Question
Related Questions
Making a bubble level (not a game but work tool) 1 Answer
Super Sonic Movement Help 1 Answer
MLAgents error: SubprocessEnvManager had workers that didn't signal shutdown 0 Answers
Adding Wander option to AI 1 Answer
Agents in a distributed game 0 Answers