RVO and Rigidbody2D

Hello,

I’m having trouble getting the RVO element working with my 2D movement. How I currently move:

            Vector2 dir = (path.vectorPath[index: currentWaypoint] - transform.position).normalized;
            dir *= movementSpeed * Time.fixedDeltaTime;

            myRigidBody.AddForce(dir, fMode);

After looking at the 2D RVO example, I still have trouble adding this to my rigidbody movement. Help is much appreciated! I’m not very good at scripting, but I thought this was just drag and drop to work. Am I in too deep?

Cheers,
StigC

Hi

RVO is not really compatible with that kind of movement, I’m afraid. The RVO algorithm is modelled on an agent that can change its velocity instantaneously. In your case, AddForce only changes its acceleration, which is a much weaker way of controlling an agent.