Search Unity

Navmesh obstacle weird problem

Discussion in 'Editor & General Support' started by iikii, Jan 23, 2017.

  1. iikii

    iikii

    Joined:
    Apr 25, 2012
    Posts:
    73
    Hi, when i applied the obstacle component to my navmesh object, my object went 'crazy' and move randomly in super high speed. What's the problem?
     
  2. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,334
    What do you mean by "my navmesh object". Is it a gameobject that has a NavMeshAgent?
     
  3. iikii

    iikii

    Joined:
    Apr 25, 2012
    Posts:
    73
    yeah yes, that's what i mean. My navmeshagent object already has some 'functions' to do some random navmesh path destination.
     
  4. onepixellab

    onepixellab

    Joined:
    Feb 29, 2016
    Posts:
    6
    Hi,
    I am facing the same problem in unity 5.5. Any fix?
     
  5. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,334
    Oh, forgot about this.

    Your navmesh agent tries to stay on the navmesh, and away from navmesh obstacles. When you have a navmesh obstacle on the same object, that makes your navmesh agent try to move away from itself. That's a bad idea!

    navmesh agents already work like obstacles with regards to avoidance, so you shouldn't need both.
     
  6. greysun

    greysun

    Joined:
    Feb 23, 2017
    Posts:
    9
    I know this is old but just in case anyone runs into it like I did today you may want to check to make sure that you have "Carve" checked on your nav mesh obstacle. I experienced this behavior as well. When my moving object with the agent ran into a static object with the obstacle it would just shoot off in a direction, move back to the object then shoot off again, wash rinse repeat.
    I found that I forgot to check "Carve" on the obstacle