- Home /
GUI text and texture draw order
I am trying to design GUI by creating GUI Textures and GUI Texts from GameObject menu. However Unity adjusts the draw order of these elements automatically. For example I try create a texture first and than put a text on it, but the text is put back of the texture. The only way I found to overcome this problem is that if I want to bring an object to forward of another, that object needs to be the parent object. Still this solution causes to exist a lot of parent objects.
Is there another way to adjust draw order non-programatically?
Answer by Eric5h5 · Oct 02, 2013 at 02:28 PM
The Z position of GUIText and GUITexture objects controls the sorting.
And, I think $$anonymous$$or bug (v4.01f2) GUITex(ure) parent/child doesn't correctly handle Z's.
If a parent has Z=2 and the child has Z=0.5, the child (which should have Z=2.5) is drawn behind. I had to increase child Z to 2.001+ to put it in front.
@Owen: Unfortunately, it doesn't look like a bug, but a feature. It only takes localposition.z into account.
Your answer
Follow this Question
Related Questions
EditorWindow GUI.Button activation is oposite from render order? 3 Answers
Strange Render Order Issue 0 Answers
why wont Static mesh always batch with same material? 0 Answers
Particle Systems, sorting, draw order and performance 1 Answer
How do I prevent GlobalFog from obscuring particle shaders? 1 Answer