So what I’m trying to do is place an object into the NavMeshAgent.destination, where I’m stuck
is that I don’t know what to type after GetComponent (“NavMeshAgent”).destination = ???
When I was sending the scripted object to a destination position I could simply type
transform.GetComponent (“NavMeshAgent”).destination = target.position
But now that I’m trying to determine the scripted object’s destination position I’m not getting a response when I type the same thing. So I checked what the destination looks like with Debug.Log and it showed (X , Y , Z) coordinates
like so: (984.3, -4.3, -214.5)
So I tried typing .destination == Vector3(984.3, -4.3, -214.5) but still nothing happened.
Could someone please explain what I’m doing wrong
var target : Transform;
function Update() {
if (GetComponent ("NavMeshAgent")**.destination == __target.position)__** {
Debug.Log ("destination is now target");
}
Debug.Log (GetComponent ("NavMeshAgent").destination); // checking what destination parameter looks like.
}