Search Unity

Question What does the RayPerceptionSensore3D compocent observe?

Discussion in 'ML-Agents' started by ikwing9, May 14, 2022.

  1. ikwing9

    ikwing9

    Joined:
    Apr 15, 2022
    Posts:
    1
    Hello
    I'm just learning about ML-agent.

    Does the "RayPerceptionSensor3D" component observe only tags and positions that have been hit by rays?
    Then, is it the same as adding the code below in the "CollectObservation" function?
    Code (CSharp):
    1. for(int i = 0; i < numOfRays; i++) {
    2.     rayHits[i] = Physics.SphereCast(each direction...);
    3. }
    4.  
    5. foreach(RayCastHit rayHit in rayHits) {
    6.     sensor.AddObservation(rayHit.collider.tag);
    7.     sensor.AddObservation(rayHit.collider.transform.position);
    8. }
    9.  
     
    Last edited: May 14, 2022
  2. jrupert-unity

    jrupert-unity

    Unity Technologies

    Joined:
    Oct 20, 2021
    Posts:
    12