RVO with rigidbody

Hi :),

just a simple question (hopefully):

How do I get RVO working with agents that have a rigidbody attached, and are moved by applying forces to them?

Hi

I do not think the included RVO Controller has any support for rigidbodies. This is mainly because local avoidance works best when it handles it’s own collision. It needs to be able to set a specific velocity each frame or else the simulation might fail (i.e units will overlap, which will not look good).
You can of course implement that yourself if you really want it (quite easily with little fuzz I think).

It would be done easiest by modifying the RVOController.cs script.

Awesome, thanks for the hint, got it working :).

After a lot of trial and error it was really easy to get it working:

At the RVOController.cs script I altered the line 179 as follows:

//tr.position = rvoAgent.InterpolatedPosition + Vector3.up * height * 0.5f + center; this.rigidbody.AddForce(rvoAgent.Velocity, ForceMode.Acceleration);

Great!
Just remember that using rigidbodies might affect the quality of the local avoidance.