- Home /
NavMesh.CalculatePath() is not generating correct points
Hi guys. I want to manually move my character controller along a path that NavMesh.CalculatePath() gives me. Unity's NavMeshAgent doesn't work for me, because the movement of my character controller is very custom and specific. I want the player character and the AI characters to use the same movement. The problem is that the path is not what I am expecting it to be. Here is what I am talking about.
Here the white line is the path that unity gives me. The red line is the path I want.
Here is the navmesh which looks fine.
Is it possible to somehow tweak this?
Answer by cmz-neu4590 · Jun 14, 2019 at 02:38 PM
I'm having the same problem, not sure how you are moving your controller but if it uses some sort of gravity or something that keeps it stuck to the ground you could ignore the Y axis.
Answer by Ardinius · Mar 28, 2020 at 11:43 PM
Also having the same issue, i can only guess that the navmesh agents do some addtional work at run time to get correct Y data, either raycasting or sampling the navmesh in some manner. You can manually go through your paths points and offset the Y value, bit of a hack but can work well enough.
Your answer

Follow this Question
Related Questions
NavMesh Baking Problems 0 Answers
How to save a destination on a variable from NavMesh clicking 1 Answer
How do you set up multiple navmesh agents to one target/destinations? 1 Answer
Horde of NavMeshAgents - stops to recalculate path. 4 Answers
How do I do AI pathfinding in a scene that changes drastically during play 0 Answers