Search Unity

  1. The 2022.1 beta is now available for testing. To find out what's new, have a look at our 2022.1 beta blog post.
    Dismiss Notice

NavMesh Agent avoiding it's self

Discussion in 'Navigation' started by McSwaggens, Apr 24, 2017.

  1. McSwaggens

    McSwaggens

    Joined:
    Jan 17, 2013
    Posts:
    23
    I have GameObjects/Units I want to move around the map whilst being able to avoid each other.
    I've attached a NavMesh Agent and a NavMesh Obstacle to the units and I've encountered a problem:
    When I move the unit with SetDestination it starts to avoid it's self.
     
  2. Jakob_Unity

    Jakob_Unity

    Unity Technologies

    Joined:
    Dec 25, 2011
    Posts:
    269
    You should also see a warning in the console :
    "NavMeshAgent and NavMeshObstacle components are active at the same time. This can lead to errorneous behavior."
     
  3. McSwaggens

    McSwaggens

    Joined:
    Jan 17, 2013
    Posts:
    23

    So is there a way to use an agent and have other entities avoid it?
     
  4. Jakob_Unity

    Jakob_Unity

    Unity Technologies

    Joined:
    Dec 25, 2011
    Posts:
    269
    The agents are supposed to avoid each other - depending on some settings like 'obstacleAvoidanceType' and 'avoidancePriority'
     
  5. GameDeveloperAf

    GameDeveloperAf

    Joined:
    Jul 3, 2020
    Posts:
    66
    But there is not another way to solve this issue? Everything working perfect. But the navmeshobstacle cause issues. The navmeshonbstacle avoid from itself too. I want to know is there any way to ignore self navmeshobstacle from avoid???
     
unityunity