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

Nav stoppingDistance causing trouble

Discussion in 'Navigation' started by AMIR_REZAs, Sep 28, 2015.

  1. AMIR_REZAs

    AMIR_REZAs

    Joined:
    Jan 20, 2014
    Posts:
    54
    Hello
    I have a NavMeshAgent which has a stoppingDistance to player(the target).
    The problem is that I want my NavMeshAgent move right after the bool gets true.
    But the stoppingDistance causing trouble and my NavMeshAgent doesn't move!

    Code (CSharp):
    1.                 nav.destination = player.position + navDesTemp;
    2.                 nav.speed = speedRun;
    3.                 nav.stoppingDistance = stopDistForKill;
    4.  
    5. if( bool == true)
    6. navDesTemp = transform.right * 10;