RVOAgent + Wanderer script

Hi everyone,

Im trying to make my ships move randomly around the map, before I was using the WandererSetter in the documentation with the AIPath and worked fine.
But now I wanted to add local avoidance to the ships, so I created this WanderingSetterForRVOAgent.
Seems to work well but sometimes the random script gives coordinates outside of the grid/map, and the RVOAgent is not able to detect is not a valid route.

On the left its the WanderingDestSetForRVOAgent that sets the target for the RVOAgentWanderer (right). In the picture its possible to see the values that have been given to the RVOAgent:
p1: (191.3, 2.5, -1.6)
p2: (191.3, 2.5, -1.6)

Why the p.error boolean was false?

Ok, it was a concept misunderstanding, seems the position is given even if its out of bounds but the path jut reaches the border of it…
Hence the p.error is false since its able to find an approximate path, the solution, check if the agent has reached THE END OF THE FOUND PATH, not the original target.
Am I correct?
Regards,
Juan

1 Like

That would be correct.

You can also make use of the bool reachedEndOfPath

1 Like