NavMesh.CalculatePath Produces Paths through Air

I don’t often use Unity3D’s navmesh system but I now have a need for pathfinding without agents. Paths generated from NavMesh.CalculatePath do not seem to be aligned to the navmesh and sometimes go straight through the air. Am I doing something wrong?

Might be something in your agent settings, Navmesh itself seems pretty fine.

Are agent settings used when no agent exists? I’m not using any agents. I generate a point path from CalculatePath and then I make the entity walk the path by hand without any navmesh agents.

Yeah, Agents are still used when calculating the path, since Agent Settings contain values such as their radius which might prohibit them from walking through narrow corridors and such.

1 Like

Hmmmm, I didn’t know that. I think I use the default settings for agents which would surprise me if this setting would generate paths through the air. Does anything look out of the ordinary to you here in this picture?

No, that looks pretty normal to me. Do these measurements make sense for your character?

did you do it on awake()?
I also have this issue, however run the API again e.g. after start() will give me the correct result.

Unfortunately this isn’t around the time of startup, I still haven’t found the source of this issue yet. Seems very strange a path generated from the navmesh wouldn’t align with it.

Still experiencing this issue.

Could you post your code of displaying the navmesh path? Because if you do not have a change of direction, you would get something like this. Do the navmesh agent walk through the air as well or is it just your navmesh path debug view?

I Have the same problem, the path is in air

Same problem here with static NavMesh.CalculatePath(). Tried many settings but there was no way to fix it.