- Home /
How to use Graphics.Draw draw a texture behind other GameObject?
How to use Graphics.Draw draw a texture behind other GameObject? like render a no transform GUI texture behind the mesh? My project need so strange function:( And can't render this texture on mesh , only can use Graphics.Draw.
Or , how can i control a renderOrder which can control the GUI's and mesh's renderOrder?
Answer by Claytonious · May 18, 2012 at 08:56 AM
You can use a separate camera.
Use one camera with your GUITexture in it (use the camera's culling flags so that it only draws the GUITexture's layer and nothing else).
Use the normal camera for everything else (set its culling flags to render everything BUT the GUITexture's layer).
Set the "Depth" of the 2 cameras so that your GUITexture renders first, followed by your "normal" camera with your GameObject that you mentioned.
Don't forget to make the second camera's clear flags "Don't Clear" or you will wipe out the GUITexture that you just rendered.
Answer by qingye5x · May 18, 2012 at 10:36 AM
So cool~, you are very professional in use Camera~ thank you for your answer very detail.
Your answer
![](https://koobas.hobune.stream/wayback/20220613071616im_/https://answers.unity.com/themes/thub/images/avi.jpg)