Search Unity

NavAgents at different height NavMeshes are pushing each others

Discussion in 'Navigation' started by unity_tyvmsJ5W4uaVRQ, Jul 12, 2019.

  1. unity_tyvmsJ5W4uaVRQ

    unity_tyvmsJ5W4uaVRQ

    Joined:
    May 15, 2018
    Posts:
    2
    Hi!
    We are trying to make a simple movement for ground units and for flying units. The issue is that the units are pushing each other when they are near, even they are moving on different nav meshes.

    Two NavMeshes: Ground plane at y = 0 and aerial plane at y = 1.
    Two Nav Agents: Each one with a different area mask.

    upload_2019-7-12_12-23-2.png upload_2019-7-12_12-23-35.png
    upload_2019-7-12_12-35-22.png
    There isn't any overlapping at NavAgent height (0.3) configuration

    We have tried with different navAgent height and it seems it has nothing to do with this kind of avoidance. In fact, agents with reduced radius are not pushing, which shouldn't affect.
    Also, we have disabled generating off mesh links, set the slope and the step height to 0.

    Attempt 1: Height 0.3 and radius 0.5


    Attempt 2: Height 0.1 and radius 0.5


    Attempt 3: Height 0.3 and radius 0.2


    Our temporal solution is to place the air navmesh higher (y = 2) and place the mesh on a child, so we have the same flying visual effect that we need, but we are not sure if this can cause problems in future. Has anybody come across this issue and find a solution? Are we missing something or is this a Unity's bug?

    Thanks for your help!



    EDIT:
    We have tried modifying the base offset too and it doesn't work.
    Also, we can't modify the avoidance quality to None as we want agents on the same navmesh to avoid each other, but not avoiding the agents on the other one.
    We played with different priorities as well and the result was that only one agent could push the other one, so that won't work either.
     
    Last edited: Jul 12, 2019
  2. gurayg

    gurayg

    Joined:
    Nov 28, 2013
    Posts:
    226
    Not really sure what is going on but you might want to try changing:
    -Base offset
    -Obstacle avoidance Quality set to "None"
    -Priority based on your navmesh height.

    Hope those help.
     
  3. unity_tyvmsJ5W4uaVRQ

    unity_tyvmsJ5W4uaVRQ

    Joined:
    May 15, 2018
    Posts:
    2
    Hi, thanks for your response!
    We have tried modifying the base offset too and it doesn't work.
    Also, we don't want to modify the avoidance quality to none as we want agents on the same navmesh to avoid each other, but not avoiding the agents on the other one.
    We played with different priorities as well and the result was that only one agent could push the other one, so that won't work neither.

    Thanks for your time :)
     
  4. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    2,219
    Crowd handling is a separate thing from navigation internally. They create a crowd and agents are moved using the crowd algorithm constrained to the path. So my guess is Unity just uses a single crowd, not one per surface. Which makes sense. You can setup surfaces for all types of situations, a single crowd is the only logical choice unless they expanded the system to let you specify other configurations. And I wouldn't hold my breath on that happening any time soon.