- Home /
How to fine-tune navmesh agent in scene with multiple "floors"?
I have a scene where I need my NavMeshAgents to traverse multiple floors. For the most part the AI seems to do everything alright. However there are some instances when the navigation solver chooses a destination for the AI that is on the floor above the target location. I am not sure what setting is allowing for this to happen.
In the image the AI is moving from the "1" Cube to the "2" Cube but has decided that going above the "2" Cube is the "best" path. You can see in the image the "Circle and Dotted Line" above the "2" Cube for where the AI wants to go.
It seems to be something related to the Nav$$anonymous$$eshObstacle in combination with the object being under the second floor Nav$$anonymous$$esh.
Answer by StewVanB · Jul 03, 2018 at 06:32 PM
I was able to get this to work by using the NavMesh.SamplePosition using my target position. Because the targets all have NavMeshObstacles the AI has issues dealing with the target being within the carved area. SamplePosition lets me get a point on the edge of the carved navmesh area to use as the AI target.
Your answer
Follow this Question
Related Questions
Ignoring or overruling a NavMeshAgent destination 0 Answers
NavMeshAgent Finding Alternative Route 1 Answer
Possible to edit the movement of NavMeshAgent ? 2 Answers
Editing NavMesh Paths? 0 Answers
NavMesh Agent glitches in trees 3 Answers