Setting NavMeshAgent.destination questions.
I'm doing some crowd simulations in Unity, characters lining up behind each other, but I seem to be fighting against NavMesh.
I'd like to have Left Guy line up behind the guy on the right. Currently I'm setting the NavMeshAgent.destination to a calculated point (the magenta vertical line) but NavMeshAgent.destination is adjusting itself to the red vertical line. How can I check the calculated point to check if it is a valid point on the NavMesh?
Imagine the wall was skinnier and the purple line was actually a valid point on the NavMesh. How could i detect and avoid having characters line up behind each other in this manner? (Like, the baked NavMesh shows a break, what calculations can I do to follow the edge of the NavMesh rather than skip over areas.)
Your answer
![](https://koobas.hobune.stream/wayback/20220612070350im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Nav Mesh Agent destination not lining up with actual target. 1 Answer
Cardboard and Navmesh: Problem with Player Movement 0 Answers
How to change speed for a cloned prefab instead of applying it to all instances of prefab? 1 Answer
SetDestination doesn't work after building (with images) answer please 0 Answers
Let specific NavMesh Agents ignore some Area costs 0 Answers