Search Unity

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;