I’m facing a problem with the rvoDensityBehavior.reachedDestination property. It is always returning true at the start of the movement, except for the first time or if I order a second movement without finishing the current one.
Maybe the reachedDestination of the rvo takes some time to be false after the start of the movement, but I’ve not been able to get when that happen. This is my current code:
This works for the first movement, but then the next one prints this at the start:
Destination reached: False, True
After checking the docs I’ve tried to add the movementSystem.pathPending to the coroutine condition, hoping the reachedDestination was true only until the path has been calculated, but the result is the same.
I’ve also tried to call movementSystem.rvoDensityBehavior.ClearDestinationReached() before starting the coroutine, but it didn’t work either.
Am I doing something wrong or is this a bug?
I am using last beta version: 4.3.73, although this also happened to me in version 4.3.48.
That’s odd. There’s code specifically for setting the rvoDensityBehavior.reachedDestination field to false after the destination property is changed. It will set that field to false unless the new destination is very close to the old one. How far away is the new destination?
Distance doesn’t seem to matter, I’ve just tested it and the result is the same setting the destination point far away. I’ve modified the code to print the current position and the destination when set:
Once the destination is set, an OnDestinationChanged is performed, setting reachedDestination to fasle, but then an Update is performed, setting reachedDestination to true again. In the example I learned that this seems to be caused by multiple threads. But my project that uses single threads still performs an Update after setting the destination, setting reachedDestination to true, I wonder why