Search Unity

Adding an obstacle to block pathfinding?

Discussion in 'Developer Preview Archive' started by spiralgear, Jan 30, 2012.

  1. spiralgear

    spiralgear

    Joined:
    Dec 13, 2007
    Posts:
    528
    I need to find a way to make a "dead-zone" on the navmesh at runtime that will be ignored during path finding. In my game the player moves around large containers that sometimes block routes the navagents could use. How do I mark the spot where the containers currently are as unpathable?
     
  2. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    You have two options. Either add NavMeshAgent's with the appropriate radius to the boxes. Agent <-> agent avoidance is going to do the work for you in that case. Or you need to deactivate NavMeshAgent's while you move the agents in a scripted way around the containers.
     
  3. spiralgear

    spiralgear

    Joined:
    Dec 13, 2007
    Posts:
    528
    Is there anyway to have navagents be a shape that isn't a capsule?
     
  4. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    Unfortunately no, as far as I know.