Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  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. }