Facing Direction - Steering Target & RVO


I’m having some trouble with making my 2D sprites face the right direction.

ai.steeringTarget worked perfectly before I added RVO (from RTS beta because I need locked units). Now when RVO kicks in the sprites do kinda like a sideways slide sometimes when avoiding while moving.

Is there any way to fix this or use a different variable?

Edit: Nvm, using transform.TransformPoint (ai.velocity) worked for me


transform.TransformPoint(ai.velocity) will not work if the agent is rotated. ai.velocity is a world space vector, not a local space vector. I would suggest ai.position + ai.velocity instead.