Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Navmesh agent returns path with corners in wrong order

Discussion in 'Navigation' started by SebaGioseffi, May 5, 2023.

  1. SebaGioseffi

    SebaGioseffi

    Joined:
    Oct 18, 2013
    Posts:
    7
    I am using a navmesh with agents to calculate paths in fairly large map. I am not using the agent's movement, just SetDestination and then just getting the path's info to move the entities myself. It seemed to work just fine but lately I started to notice that some agents were moving backwards when they had a clear path ahead of them.

    Here is an example of this, with colored spheres to mark the position of the nodes: Node 0 is the agent's current position and Node 3 the destination. It should go straight towards the destination, but instead it adds another node behind the starting position. What could be causing this?




    Here are the settings for the navmesh. It's pretty large, but I tried using a smaller one, also adjusting the voxel size and the tile radius, and I keep getting the same issues.