-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Description
Describe the bug
When I add the RayPerceptionSensor2D component to an agent, it report an error as follows:
NullReferenceException: Object reference not set to an instance of an object.
and then I add the tag items except the agent to clear the error, but the ray can not be seen as if it detect itself, the cast sphere can only be seen inside agent.
I print the ray information and find out the rayInfo.rayOutput.HitFraction is always zero whatever I change the sensor settings. I change the HitFraction for a try, the ray can be seen actually but it can't detect anything. All rays are hit at the end of ray length.
However, I add the RayPerceptionSensor3D for a simple test, it seems true and the ray can be seen clearly witout the error above.
Environment:
- Unity Version: Unity 2019.3.14f1
- OS + version: Windows 10
- ML-Agents version: v2.0
- MLagent Package: 1.0.2