NavigationStatus Problem

Hello, Im quite desperate about this little script I wrote.
I have tried everything which i could think of. Actually, this is my first thread after 1,5 year :smiley:
Anyway, I think its just an syntax error. Please help :slight_smile: Lukas

(Error message:

Operator ‘==’ cannot be used with a
left hand side of type
‘UnityEngine.NavMeshPathStatus’ and a
right hand side of type
‘System.Object’.
)


private var player : Transform;
private var nav : NavMeshAgent;


function Awake ()
{
player = GameObject.FindGameObjectWithTag ("Player").transform;
nav = GetComponent (NavMeshAgent);
nav.SetDestination (player.position);
}

function Update (){
if(nav.pathStatus==nav.NavMeshPathStatus.completed){
Debug.Log("Path_OK");
}
}

Try

nav.pathStatus==NavMeshPathStatus.completed

Never tried this. I was just comparing to what I saw on this page.