Using the NavigateToLocationAction node node in a behavior tree.
If the AI is already in the right location it runs this code during “Initialize”
if (GetDistanceToLocation(out Vector3 agentPosition, out Vector3 locationPosition) <= DistanceThreshold)
{
return Status.Failure;
}
In the graph I am waiting for this node to complete before moving on and this is causing it to loop indefinitely. If we are already in the target position should that not be “Status.Success”?