Set specific camera cover GUI?

I want specific camera’s viewing be positioned top of unity GUI.

Then, specific rect(positioned inside GUI rect) will only show camera, not GUI.

How can I achieve this?

Thanks…

Set the camera’s depth to be higher than the camera that renders the GUI. Set its normalized viewport to correspond with the GUI rect where you want it to display. Presto :slight_smile:

I set depth most higher, but still it is behind the GUI. Normalized viewport is set by script. But problem stand still.

If you have pro, and can’t find a better solution - you could always use render to texture and display the render texture on the GUI at a higher depth than the other GUI elements.

The GUI class (not GUITexture) always renders in front of ALL cameras, no matter the depth. If you want GUI things to be behind game world items, use a GUITexture.

Sorry but how use GUITexture? I want my some camera filming some scene(done), and I want make that as a small rect(done), and make that top over of GUI inventory screen(not done).

to do that you would use GUI.DrawTexture to render something in the context of an OnGUI interface.
you can not use the unity 1.x gui in that case (GUITexture / GUITexture) only GUI.xxx functions

Then, not the none-moving texture, but the moving camera scene can be used for GUI.DrawTexture?

You can draw a viewport on top of GUI elements. You must call Camera.Render() on the camera you want rendered, after your call to GUI.Whatever, such as at the end of OnGUI().

1 Like

Perfect solution, thank you!