I’m having an issue with NavMesh pathfinding in Unity. Instead of taking the shortest route (yellow), my AI agent follows a much longer path (blue), as shown in the screenshot below:
I am not sure as you have provided very little information. My guess is that there are two different navmesh layers the lighter-coloured area with higher pathing costs, and the darker-coloured area with lower pathing costs. Your agent is trying to walk in the lower-cost area. I might be completely wrong…
Yes, that’s correct. The issue occurred because I was using two different NavMesh surfaces. After adjusting it to use a single surface for the entire model, the issue was fixed. Thank you!!!