Search Unity

Some NavMeshLinks cause weird behaviour in NavAgents (+upstairs/downstairs difference)

Discussion in 'Navigation' started by JeffersonTD, Feb 27, 2020.

  1. JeffersonTD

    JeffersonTD

    Joined:
    Feb 5, 2013
    Posts:
    268
    I'm experimenting a little bit with NavMeshes and NavMeshLinks, and I'm getting some weird behaviour with the agents. Here the P presents the player, and the red arrow roughly represents the route an enemy is going, when trying to reach the player. So the enemy first navigates correctly down the stairs, but soon thereafter goes on this weird mission to the right for no clear reason.
    upload_2020-2-27_22-42-50.png

    I did a bit of testing and found out that the culprit is a NavMeshLink on the right. If I remove that, the enemy tracks the player normally, but why can this small link in a very wrong direction be drawing the enemy towards it when there is a very clear route to the player? Any ideas?

    Another question for which I couldn't find an answer for: is there some easy way of defining a step height that is traversable downwards, but not upwards? The max slope seemed to work like that: only limiting the upwards direction. Why couldn't steps be defined similarly, one value for upstairs and one value for downstairs?