Search Unity

NavMeshAgent's are ignoring their Priority and they are pushing eachother instead of avoiding.

Discussion in 'Navigation' started by RIw, Sep 23, 2015.

  1. RIw

    RIw

    Joined:
    Jan 2, 2015
    Posts:
    90
    Hello!
    I've made a simple AI Script,which is based on a NavMeshAgent,which works perfectly but It has 1 issue.
    When I will create 10 NPC's with my script,and when I will give them 1 Target - a player for example.
    They are pushing eachother but I want them to avoid their "brothers" I tried to do something with localAvoidance Property but It doesn't work for me (I see no difference).
    How can I solve this ?
     
  2. svendkiloo

    svendkiloo

    Joined:
    Dec 2, 2014
    Posts:
    11
    Did you ever find a way to get this working?
     
  3. calebc01

    calebc01

    Joined:
    Jul 21, 2015
    Posts:
    62
    The obstacle avoidance behavior doesn't quite work that way. Agents with a high priority ignore objects of lower priority - in effect, this causes the lower priority agents to try to avoid high priority agents, but the high priority agents go on their merry way.

    There is no intelligent negotiation of position and time to keep agent from bumping into each-other, and hence there is no guarantee that a high priority agent will force a low priority agent out of the way. If you want to do this, you'd need to check to see if a position is occupied or about to be, and then give your agents new positions that don't interfere with each-other.
     
    Roger-W likes this.