My player uses a NavMesh agent that moves the player towards the location where the mouse is clicked. The game world is composed of separate NavMeshes connected by OffMeshLinks.
Assume the following setup:
- NavMesh A and NavMesh B connected by a bidirectional OffMeshLink.
- The player's NavMesh agent (with auto-traversal of NavMeshLinks) is on NavMesh A.
- I click on NavMesh B.
Now the agent will move to NavMesh B through the OffMeshLink. Say that during the movement on the OffMeshLink I decide that I don't want the agent to move to NavMesh B e.g. I see an enemy object on NavMesh B; and consequently I click on NavMesh A to go back to a safer place.
What happens is that the agent will continue traversing the OffMeshLink (towards NavMesh B), not taking into consideration the new destination (NavMesh A).
How would I fix this? How would I make the agent listen to the updated destination while on the OffMeshLink?