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

Grid Sensor

Discussion in 'ML-Agents' started by mattinjersey, Nov 29, 2020.

  1. mattinjersey

    mattinjersey

    Joined:
    Dec 3, 2016
    Posts:
    42
    For Grid Sensor is there a mode where the grid does not move with the player?
     
  2. mattinjersey

    mattinjersey

    Joined:
    Dec 3, 2016
    Posts:
    42
    Another question about Grid Sensor. I am making an asteroids game and I can see the "Asteroids" but not the "Player" on the grid. Any thoughts why?
     
  3. mattinjersey

    mattinjersey

    Joined:
    Dec 3, 2016
    Posts:
    42
    Yes I solve this. The current GameObject is explicitly skipped in the GridSensor code and we can change that.
     
  4. mattinjersey

    mattinjersey

    Joined:
    Dec 3, 2016
    Posts:
    42
    Yes I could solve this. We need to take out the transform.position in the code where it finds the grid box. Also in the code where it displays the grid.
     
  5. celion_unity

    celion_unity

    Unity Technologies

    Joined:
    Jun 12, 2019
    Posts:
    289
    We currently require that SensorComponents be at the same level in the scene hierarchy as the Agent, or at a lower level, so there's no easy way to make a sensor that isn't "attached" to the Agent. There's a similar discussion (with some workarounds) here: https://forum.unity.com/threads/how...cted-transforms-rotation.843103/#post-5676712
     
  6. mattinjersey

    mattinjersey

    Joined:
    Dec 3, 2016
    Posts:
    42
    I did attach Grid sensor to Agent and it works fine and it does not move or rotate with the Agent.