- Home /
Question by
Scrawny · Oct 10, 2017 at 07:31 AM ·
onguidepthdrawtexturedraw order
GUI.DrawTexture doesn't obey drawing order in hierarchy?
I have a fade to black script I use between scene transitions using GUI.DrawTexture() in OnGUI(), and a loading bar that's basically just a slider. The problem is that the fade-out always draws itself on top of the loading bar, along with everything else. Changing it's location in the hierarchy changes nothing, neither does setting GUI.depth or the 'z' coordinates of any of the objects. Does OnGUI just keep redrawing itself over the canvas, ignoring the hierarchy draw order? Does GUI.depth only affect things drawn in OnGUI? How should I go about solving this?
Using the 'Screen Space - Overlay' render mode, in case that's relevant
Comment