GameObject on top of GUI

I got some GUI Textures, buttons and text in the screen and I want a GameObject to appear in certain occasions(for example, on a click). The things is that the GameObject is render UNDER GUI and not ON TOP.

On this post GameObject Over GUI - Questions & Answers - Unity Discussions Eric suggests a solution. Anyone got another idea or could explain me how to implement Eric’s solution? Because I see that this is a recurrent problem!

Thanks! :slight_smile:

  1. Add a new Layer tag “gui”.
  2. gui elements: Set Layer of your gui-elements to “gui”
  3. (first)gui camera: set Culling Mask to “gui” only
  4. add second camera (object camera at the same position as the first camera)
  5. object camera: set Clear Flags to “Depth only”.
  6. object camera: set Culling Mask to everything except “gui”
  7. object camera: set Depth to a higher value than gui camera (e.g. gui camera -1, object camera 0)
  8. object camera: uncheck GUILayer

All he is saying is make a second camera, give it a higher dept than the first camera and set it to dept only. Have the GUI on the lower dept camera and the game object in the higher dept camera. Win.

Add second camera, set it to a higher depth, and set clear flags to depth only. If you still have issues you may be forgetting another step. Remove the GUILayer component from the second camera you added if it was there by default. Now this camera will draw the 3D model on top of the other camera drawing the GUI.