Hello, I am a new user to Unity 3D. Currently I am trying to train ML Agents to detect objects using Ray Perception Sensor 3D, and it is not working. I am thinking of changing the Ray Perception to RayCast, so I was wondering how exactly the Ray Perception Sensor 3D differs from RayCast.
rayperception is a bunch of raycasts, it returns the tag and the distance among a few other things for the agent to automatically observe.
Hi, such as Ray 3D, what can it get info? Position? velocity?
the rayoutputs is what it can determine
https://docs.unity3d.com/Packages/com.unity.ml-agents@1.0/api/Unity.MLAgents.Sensors.RayPerceptionOutput.RayOutput.html
so
public bool HasHit // if it has hit something
public float HitFraction // the normalized distance to the hit object.
public bool HitTaggedObject // if the object is in the list of detectable tags
public int HitTagIndex // the index of the tag within the list
it will not directly pick up position as this would be meaningless to the AI, you should use directions and distances to let the AI “see” it’s environment.
velocity is not something it will get by default but it can be learned through changes in distance (might be worth using some stacked observations if velocity is important) or you can supply it via an RB.velocity observation etc.
Thanks, it helps me!