Search Unity

How to make two big navmeshagent enter a narrow space by order

Discussion in 'Navigation' started by evapro, May 22, 2017.

  1. evapro

    evapro

    Joined:
    May 22, 2017
    Posts:
    5
    I'm now facing a big problem: In my game, I use navmeshagent to move, there are 2 kinds of agent radius, one is smaller for npc and the other one is huge for tank. Everything works well ,expect a case that is :when two or more tanks go opposite and reach the gate or spaces like a narrow thing. The two tanks just behave like freeze.

    I think I got a stupid way to figure it out,but seems it hit the performance a lot.
    so can somebody help me or show me ground solution idea?
     
  2. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    558
    Try setting obstacle avoidance priority higher for one, and the higher priority one might shove its way through, not exactly elegant, but otherwise I believe A* Pathfinding pro on the asset store has some methods for politely waiting one's turn. Not cheap tho and is a totally different nav system. There is a free version though...
     
  3. evapro

    evapro

    Joined:
    May 22, 2017
    Posts:
    5
    Thank you for replying. However, I've already set higher priority for tank and lower for NPC, and the problem is between tank and tank. They got the same priority and behave strangely in my case. Do you mean even the tank set different priorities?
     
  4. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    558
    Yeah, try it.