In most cases, when I call SetDestination()
on a NavMeshAgent to go to a location that no complete path exists, the agent will go as close to the location as possible and then stop.
When I try to run SetDestination()
continuously in an agent's Update()
to an unreachable location, occasionally the agent just does not move at all. After calling a separate SetDestination()
(to the same location) from a different script that sets a destination on mouseclick, the agent moves as close to the location, which did not occur when SetDestination()
was called in Update()
.
Why is this happening and when does unpredictable behavior occur with NavMeshAgents and SetDestination()
?