Hi all,
I have some pretty simple NavMeshAgent code:
public void SetDestination()
{
if (navMeshAgent.isOnNavMesh)
{
Debug.Log("Setting Destination to " + desiredDestination);
navMeshAgent.SetDestination(desiredDestination);
Debug.Log("NavMeshDestination is " + navMeshAgent.destination);
}
}
In a test scene with a flat terrain, it works fine. Debug.Log
shows the updated destination, the actor moves, all that.
In my main scene (which is the damascene from the Meadows package from NatureManufacture), the code doesn’t work. There are no errors, no warnings. The Debug.Log
simply shows the same navMeshAgent.destination
regardless of how many times I attempt to SetDestination()
.
I’m at a complete loss on how to trouble shoot this. I’ve rebaked the NavMesh multiple times. Moved the agent around to flat area. Nothing seems to work, and since there are no errors, I have no idea where to look for a fix.
Any thoughts? Thanks!