Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

Question Observation of other agents' information in multi-agent

Discussion in 'ML-Agents' started by mehdi_1234, Oct 8, 2023.

  1. mehdi_1234

    mehdi_1234

    Joined:
    Jun 16, 2023
    Posts:
    4
    I want to know when I use the information of other agents in the received information of agent 0, is its information observable everywhere? If yes, how to observe this information when agent 1 is within a specified distance from agent 0?

    Code (CSharp):
    1.     public override void CollectObservations(VectorSensor sensor)
    2.     {
    3.  
    4.     if (transform.position == area.AgentsList[0].Agent.transform.position)
    5.             {
    6.                 sensor.AddObservation(transform.InverseTransformDirection(area.AgentsList[1].Rb.velocity));
    7. }
    8. }