Drawing gizmos with hideInHierarchy

It seems that it is impossible to draw gizmos for objects hidden in the hierarchy. Why is that? Is there any workaround? I would like to decouple drawing gizmos from the actual mono behaviour class, so I have a singleton game object that is hidden & not saved in a scene. With this setup, it seems that I am unable to draw gizmos.


In that case, you can draw during Update instead (or some other function that is invoked every frame).

I think the rendering might be a little bit different. Last time when I’ve tried this the drawn elements were flickering a bit while those rendered as gizmos were perfectly still.

Are you drawing things in edit mode or in play mode?

Both, but I think the flickering happened in edit mode.

Yeah Update doesn’t necessarily run every rendered frame in edit mode.

You might be able to run it in OnSceneGUI (if you restrict it to only the Repaint event). Otherwise, I’d recommend keeping an object visible in the hierarchy to receive the DrawGizmos event.