Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Sharing a GridSensorComponent across multiple different agents.

Discussion in 'ML-Agents' started by al3xj3ns3n, Mar 16, 2023.

  1. al3xj3ns3n


    Sep 10, 2018
    I've been trying to get this working for a bit now but I'm unsure if the functionality is available or not. Currently in my ML-Agents training project each individual agent has their own GridSensorComponent to assist in navigating the training area, but the grid components are quickly hurting performance to the point of unusability as the number of agents increases. I'd like to refactor the observational parameters to instead have a single large GridSensorComponent which covers the entirety of the training area, and pass the values it generates to all the agents every CollectObservations instead, but so far in my investigation I'm unsure the best way to actually make that happen. Is there a good way to capture the observations generated by a GridSensorComponent and send them to an agent without the GridSensorComponent actually being directly attached to that agent?