I have a 2-player game, each player has a team of objects that run out onto the play surface at the start of the game, from a fixed point, to their own destination point.
Each object uses standard Capsule Collider, Rigidbody, RVO Controller, Seeker and AIPath components (along with multiplayer Network Object, etc. from Photon Fusion).
Maybe 1 in 4 times I start the two clients, one of the objects will collide with another object (on its way to its own destination) and get stuck. If I quickly disable/enable the RVO controller on that stuck object, it carries on and arrives OK. There are no “obstacles” - just other RVO objects. The objects often collide but usually don’t get stuck.
What should I look for to see why it’s getting stuck - and any quick ways to solve it?
Just a shot in the dark, but is your collider larger than the RVO Controller radius? That might cause an issue like this.
In my use of Astar I don’t use collisions between pathing units and just let the RVO handle it. If you need colliders on them for other things, then its probably best to ensure that they don’t collide with each other by using Project Settings → Physics → LayerCollisionMatrix.
The collider was slightly bigger so I’ve now changed it for consistency - however I double checked and already had the LayerCollisionMatrix set so that the objects don’t collide with each other :-(.
When an object gets “stuck” it’s after some RVO collision, but then the other object moves away, leaving the stuck object on its own. So I’m not sure why it doesn’t then just proceed to its destination. I added an “unstick” script that checks if the object doesn’t move for a time, and then call aiPath.SearchPath() but doesn’t seem to work.
Thanks for spending time on this. I had disabled the RVO on remote players, but the AIPath was still active. This may have worked - hasn’t happened since!