Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Using SetDesination, sometimes agents go to roof above me

Discussion in 'Navigation' started by radiantboy, Mar 3, 2020.

  1. radiantboy


    Nov 21, 2012
    So I have a ton of agents following me using setDestination, it works well... until I go inside a building, then they tend to go on the roof and stand exactly above me, obviously I want them to follow me into the building. The nav mesh shows that they can so I am wondering why they wont... My patrolling enemies have no problems getting to waypoints in the building so it's strange. If I leave and slowly tease them in, they do come in.. any ideas?
  2. DwinTeimlon


    Feb 25, 2016
    Can you post a screenshot of your navmesh?
  3. Lork


    Jul 12, 2013
    When given a choice while determining the closest point on the navmesh to a given destination, NavmeshAgent seems to almost always choose the point above it, even if the ground below it is way closer.

    Try setting your destinations closer to or exactly at floor level (eg. by raycasting down to find the precise point).
    Last edited: Mar 12, 2020
    radiantboy likes this.