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
Anyway, I think its just an syntax error. Please help 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");
}
}