Search Unity

Random "Stuck" NavMeshAgents in Unity 5.6.1

Discussion in 'Navigation' started by PetroUnityDev, Jul 17, 2017.

  1. PetroUnityDev

    PetroUnityDev

    Joined:
    Nov 19, 2014
    Posts:
    5
    Randomly, my NavMeshAgents get "stuck" appearing to attempt to path across non-walkable areas. The agents will go to a corner and either sit their or fidget/jitter. This issues occurs randomly on all maps in our game and happens with any number of agents, but generally all in the same place.

    The NavMeshAgent in this case started on the pad of the structure (blue circle). The agent's destination was set to the "HQ" (red circle). The agent navigated to the point at which it is shown stuck going toward the HQ so it seemed to be working up to a point.



    Here is the stuck agent from another view with a closer look at the navigation debug information.



    I did note that the NavMeshAgent component's hasPath value is true and the pathStatus value is PathComplete, but the path has zero corners. Also, the remainingDistance is infinity. Below is a look at the state of the stuck NavMeshAgent.



    The nextPosition value shown above is the position at which the agent is sitting "stuck".

    Here is what the NavMesh looks like in the place the agent is getting "stuck".



    Anyone have any thoughts on what is causing this and how I might fix it?