ho to draw a camera over gui lik this:
You create two cameras.
- The first Camera will draw the GUI. Make sure the GUILayer checkbox is checked, and Flare/Audio Listener are unchecked in the camera, and the Clear Flags is set to Skybox. Also remove everything from the Culling Mask. Set the depth of the camera to 0.
- Create a second camera, this will display the objects on top of the GUI. Set this camera’s Culling Mask to everything, the Clear Flags to Depth Only, and the depth to 1. Make sure the GUILayer is unchecked, and the Flare/Audio Listener are checked.
Explanation:
The first camera will only display the GUI (it won’t display 3d objects because culling mask is set to nothing). It will clear whatever appeared on the screen before (because you set Clear Flags to Skybox). It will be drawn of screen first, because it’s depth is lower than the second camera.
The second camera will only draw the objects, because it’s culling mask is set to everything, but it won’t draw the GUI, because it’s GUILayer is disabled. Unlike the first camera, it will not clear what was drawn before it, because the clear flags are set to Depth. So it will draw on top of the GUI that the first camera drew, instead of replacing it.
So you have a GUI as background, and any 3d objects drawn on top of it.