Hello. I am trying to display Ray Perception Sensor Gizmos. I attached several Ray Perception Sensors to my airplane agent but they didn't appear in Scene. I saw this post https://forum.unity.com/threads/no-visible-gizmos-for-ray-perception-sensor-component-3d.824529/ and tried to learn from PushBlock Example. I did similar setups but cannot make it. Gizmos did show up in PushBlock Exmaple. Could anyone help me? Thanks!
What is the Behavior Type of the Agent's Behavior Parameters? If it's set to "Heuristic Only", the gizmos won't draw in version 0.14.1 (this will be fixed in the next release).
I used "Heuristic Only" but when I changed Behavior Type to "default", there was still no gizmos. I am using version 0.13. Do I need to write some code like Debug.Draw to make it appear?
I might find the problem. OnDrawGizmos() of RayPerceptionSensorComponentBase.cs file does not work in my case. Code (CSharp): if (m_RaySensor?.debugDisplayInfo?.rayInfos == null) { return; } My code directly returns and doesn't run the drawing part below. If I remove or comment these lines, gizmos can show in play mode. Any idea of what causing this premature return? Thanks.
Which version of the code are you looking at? In the 0.14.1 release, that line is used to guard against null references - if the method was returning on that line, then either debugDisplayInfo or rayInfos was null, so this part of the code https://github.com/Unity-Technologi...RayPerceptionSensorComponentBase.cs#L109-L115 would definitely crash. Anyway, if you're happy with your workaround for now, that's fine; this will all be improved in the next release.