Hi guys,
I am trying to make a GameObject with a NavMeshAgent rotate around a pivot. I need to use the agent and not the Transform, so Transform.RotateAround()
is not an option here.
What I currently have is the following:
void RotateAgentAroundObject(GameObject obj)
{
var offsetObj = obj.transform.position - transform.position;
var dir = Quaternion.Euler(0, 30, 0) * offsetObj;
dir += transform.position;
agent.destination = dir;
}
The question is: how do I influence the radius of the rotation here? Where should I intervene to, say, make the agent rotate around the GameObject
at 5 units of distance?
Thanks to anybody!