How to configure 2D RVO in my project

Hey guys,
I’m making a simulation game and I am trying to configure 2D RVO.

I attached a RVO simulator script to my scene’s A* object which also holds the script “A Star Path”. This is an empty object.

I have the scripts : Seeker, AI Lerp, Simple Smooth Modifier, and RVO controller attached to my objects that will be doing pathfinding. The object is a 2D sprite with a circle collider and rigid body. Removing the circle collider and rigidbody didnt seem to have any effect on my problem. The sprites are all at Z=0, and the floor is also at Z=0. The RVO controller has a radius and height of both about 0.55. Mask Everything, Layer Default Agent, and Collides with Everything.

I have some square blocks that have the RVO square obstacle attached to them. The pathfinding worked fine before i added the RVO scripts, now they pathfinding

So the problem im having is when I run the simulation, the pathing objects start teleporting and shooting in random directions. They will occasionally find a path, but it doesnt seem to have any avoidance. Without RVO they are programmed to just find a random path within a couple of units around them and go towards it. It works fine until I add all the RVO components. I have taken a video of my issue and have posted the link below. Please let me know if you can help!


The RVO version in the current version of the project does not support 2D, it only supports agents moving in the XZ plane.
In the beta they support 2D however.

Also, AILerp is not intended to work with RVO. The AILerp script is specifically written to follow the path exactly, it will just interpolate along the path. However RVO requires that it deviates from the original path in case it needs to avoid other agents. Unfortunately right now there is no movement script that both supports 2D and RVO (even in the beta), I aim to add such a script in the future. In the meantime you can try to see if you can modify e.g the AIPath script to work in 2D.

Hey Aron,
Thanks for the reply. I understand and am looking forward to the 2D RVO release. In the meantime, I think I will convert the project to 3D and use 2D sprites instead. That way I should be able to use the RVO and have it look 2D at the same time. Thanks for your help!

1 Like