RVO with colliders?


currently i’m working on my rpg.
The user controls the main character playing around within the city;
The character can either be moved manually(when user clicks on the screen) or automatically(when choose a npc to navigate to, using pathfinding). This moving is done by RVOController.

My question is how to prevent the character moving out of the scene while accepting user input(manually) as destination?

  1. I was trying to add physical collider and ridigbody on character and mesh colliders on scene.
    But my character hangs there when it colliders with the scene. Or considering collders(physcis) is totally wrong?
  2. I tried to use RVOObstacles, but my scene is relatively complicated with a bunch of small accessories.

Any other suggestions? Thanks in advance.


Are you using a recast graph?
If so you can use the RVONavmesh component which will create obstacles around the border of the navmesh.
However make sure that you download the latest beta version since there is currently a bug in the latest release.

You can also try to use the RichAI movement script which clamps the position of the agents to the navmesh.

Hi, after updated to the latest version, it works and solved my issue. Thanks!

Hi, this is a test scene with a simple cube as the walking ground. And obstacles are generated by RVONavimesh. Everything works fine but I found my character will pass through the obstacles at corners.

Am I doing something wrong?

//fine to block the character inside the green lines.

//oops, pass through

I also tried RVOSquareObstacle with keep in mode. The corner can be passed through too. Is it a bug?

Yes, sorry. That is currently a known bug.
In your case however I would recommend using navmesh cutting instead of an RVO obstacle (or perhaps both) since your obstacle is very large compared to the agent size.
See http://arongranberg.com/astar/docs/class_pathfinding_1_1_navmesh_cut.php