The NavigateTo function internally has its own loop, so any time you call NavigateTo, the code will run until the Navigation_result is returned, at which point the navigateTo function stops running. What you need to code is a race that would be something like :
race :
–The navigate to function succeeding
–and the perception trigger that interrupts it
That way, the code will try to run both until only the first one succeeds and the other is interrupted and cancelled. If you are wanting to test it on a button, you can Await the button’s ‘Interacted with event’. So the code would be something like:
Here is a better example of the indented race code syntax: