Search Unity

NavMeshAgent Won't Move

Discussion in 'Scripting' started by renman3000, Nov 28, 2014.

  1. renman3000

    renman3000

    Joined:
    Nov 7, 2011
    Posts:
    6,697
    Hi there,
    I am trying to get my navMeshAgent to move but not succeeding.

    Code (csharp):
    1.  
    2. //in update
    3. agent.setDestination(pos);
    4.  

    Is not doing the trick. My agent does not move at all. What's going on?
     
  2. Fluzing

    Fluzing

    Joined:
    Apr 5, 2013
    Posts:
    815
    agent.SetDestination

    Spelling is really important in programming.
     
  3. renman3000

    renman3000

    Joined:
    Nov 7, 2011
    Posts:
    6,697
    edit.
    So I have just added a value to the transform position and it worked!
    Now to just get the tap pos working.
    Cheers!

    Ps. I had the spelling correct. It was the position I called. I believe it added vale to y and thus was impossible to reach. Not sure, but it did not fire.
     
    Last edited: Nov 28, 2014