RVO Error Quick Fix

In RVOExampleAgent.cs Line 134

while ((controller.To2D(pos - vectorPath[wp]).sqrMagnitude < moveNextDist*moveNextDist && wp != vectorPath.Count-1) || wp == 0)

There is a precondition →

if (vectorPath != null && vectorPath.Count != 0)

which does not work. Because when the vectorPath.Count == 1, then there will be an IndexOutOfRange Error the second time the while loop runs.

To fix this, just change the line to

if (vectorPath != null && vectorPath.Count > 1)

Error can be reproduced by going to the RVO scene in the examples and changing the RVOAgent Prefab → change “Radius” in RVOController.cs to “2”, as well as “Ground Mask” in RVOExampleAgent.cs to “Default”; then just start the scene and wait until the error appears in the console.

1 Like

Thanks! This will be fixed in the next beta version.