Navmeshpath is not going around obstacles

Hi,

I use a navmeshagent that doesn’t move to check if the player enclosed his castle after spawning walls.

Sometimes the agent does not calculate the path correctly, instead of calculating a path around the objects it just stops infront of them and I can’t figure out why. (See image)

Is there any way to change this behaviour?

Greetings Maikel

9103405--1261888--Agent.PNG

Use the navMeshPath status to check if a path is partial or invalid, if it is invalid wait something like 0.5 seconds and try to calculate the path again.