See the Simulator's list of agents

I am trying to keep track of the position of all my gameobjects. Since the simulator is doing this anyway (i think), is there a way for me to get this agents list, and the agents’ positions from the Simulator class?

Basically I want the objects to behave different based on their distance from each other and figure that since their positions and distances are already being tracked I could just use that data in another script instead of doing the same work twice.

Well, the simulator stores all the agent’s positions, but it has no references to e.g the RVOController components. The RVOController will internally add a new Agent instance to the simulator which doesn’t know anything about the RVOController.

My c sharp level is quite low so maybe I’m not understanding. When I look at the Simulator class I see that there is an agents list but I am having trouble exposing it. I would like to be able to access this list, and the list with the positions, from another class. Is this possible?

Hi

Sure you can do that like this

 RVOSimulator rvoSimulator = ...;
 var agents = rvoSimulator.GetSimulator().GetAgents();
 var positionOfFirstAgent = agents[0].Position;

However since this is what you want:

You would have to somehow determine which object a particular agent is linked to, and that is not stored anywhere.