Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

NavMeshAgent with Collider as Trigger call OnEnter/OnExit endlessly

Discussion in 'Navigation' started by Ramazoid, May 11, 2015.

  1. Ramazoid


    Mar 11, 2014
    Hero have NavMeshAgent component and capsule collider as trigger. On collide with someones collider (as trigger too) there is invokes both OnTriggerEnter and OnTriggerExit event on Hero on both colliders. Start calls, call every frame, and ends when colliders stop intersect.

    Rigidbody on Hero. Have or not Rigidbody on collided thing - not matter.

    Without NavMesh everything is ok.

    Is there a way to solve problem, or I have to give up NavMeshAgent?
    uygaruncosoft likes this.
  2. Chromophone


    May 31, 2015
    I'm experiencing the same issue. Did you manage to solve it or does anyone know why this keeps triggering endlessly?

    Thanks in advance!
  3. McMayhem


    Aug 24, 2011
    I wouldn't throw the NavMeshAgent away just yet. There are still a few steps you can try to debug this situation.

    I assume you are running some kind of check inside the OnTriggerEnter() thread to make sure the object it's colliding with is the right one for whatever it's doing.

    What you want to do now is find out what object is causing the continuous call. Try adding this to your OnTriggerEnter() code:
    Code (CSharp):
    1. void OnTriggerEnter(Collider other)
    2. {
    3.      //Put this above all the other code so that you know it's getting called correctly.
    5.      Debug.Log(;
    7. }
    That should at least let you know what it's colliding with.