I have a scenario where a state change is happening where it is going from generating random paths (wandering) to ab paths (chasing target).
In some cases the random path is still being generated at the point of transition so when the chasing is called it mentions that it has cancelled the previous path. So I was wondering what is the correct way to cancel a path mid generation?
You can call the Error method on the path, that will make the system abort the calculation of it and when the callback is called it will have error=true.
However if you are using a Seeker you should know that if you request a new path before the previous one has been fully calculated, it will automatically cancel the previous path request (in the error message on the path it will say something like “Canceled path because a new one was requested”).