Search Unity

  1. Get the latest news, tutorials and offers directly to your inbox with our newsletters. Sign up now.
    Dismiss Notice

Bug with Unity 5.4 and navmesh agent for destination outside of navmesh?

Discussion in 'Navigation' started by Nicolas-Liatti, Oct 3, 2016.

  1. Nicolas-Liatti

    Nicolas-Liatti

    Joined:
    Jun 19, 2013
    Posts:
    89
    Hi,

    I was under the impression that, in the previous versions of Unity, even if the destination was outside of a navmesh then the agent would go as close as possible.

    However with Unity 5.4.1, if I set a destination which is not reachable, the agent won't even move.

    Is this intended? Or is a bug?

    Cheers,
     
  2. Jakob_Unity

    Jakob_Unity

    Unity Technologies

    Joined:
    Dec 25, 2011
    Posts:
    269
    Could you specify "not reachable" ?
    is it a point on a navmesh but disconnected - or just somewhere far from any navmesh
     
  3. Nicolas-Liatti

    Nicolas-Liatti

    Joined:
    Jun 19, 2013
    Posts:
    89
    Actually I found the problem: on big maps, when I set "Set Destination" to 2 navMesh Agent, the agents don't move if the navmesh iteration is set to 500.
    I had to set it to 1000 or more and it solves the problem.

    Maybe you should put something in a console to tell that the path cannot be computed if the iteration is too small?
     
  4. Jakob_Unity

    Jakob_Unity

    Unity Technologies

    Joined:
    Dec 25, 2011
    Posts:
    269
    hmm - that's strange. Setting the https://docs.unity3d.com/ScriptReference/NavMesh-pathfindingIterationsPerFrame.html to higher or lower number should not affect behaviour - only the number of frames it takes to find a path there - any chance you have a (preferably small) repro. case you could submit as a bug. Then link to it from here - or PM. ?


     
  5. The-Sam

    The-Sam

    Joined:
    Sep 12, 2015
    Posts:
    1
    Where do you find that setting? I can't find it anywhere and nothing on the internet is helping me make this NavMeshAgent move.
     
unityunity