- Home /
NavMeshAgent Destination Problem
Heya All,
Perhaps someone can solve this one for me because I am at a loss. I have an intro scene set up and I have designated my player as a navmesh agent. I have 2 destinations. it is supposed to travel to the first one, pause for some voice acting and when the gate opens travel to the other. It was working fine until recently right when I'm about to release the demo. I am having issues. It moves to the first destination fine then after the gate opens it starts to go to the second destination then turns around and goes back. I can't figure out why. I am calling the voids seperately from a coroutine
The voids...
void TargetDestination()
{
Vector3 targetVector = dest.transform.position;
monnav.SetDestination(targetVector);
}
void Destination2()
{
Vector3 targetVector2 = dest2.transform.position;
monnav.SetDestination(targetVector2);
}
The Coroutine
IEnumerator stepsoff()
{
yield return new WaitForSeconds(2.0f);
TargetDestination();
steps.SetActive(true);
//Stuff In Between
yield return new WaitForSeconds(5.5f);
Destination2();
steps2.SetActive(true);
I have both dest and dest2 Transforms set in the editor to the correct transforms. I am literally at a loss here. Please Help