Reputation: 121
I added a new layer called it: CameraLayer.
I have one Camera as child under the first ThirdPersonController tagged as MainCamera. I set that this camera will show everything but the CameraLayer. In the inspector in Culling Mask. Everything marked but not the CameraLayer. And now i see in the Culling Mask: Mixed. This is the main camera showing everything.
The second camera i added as child under a Cube. And i want that this camera will show only the cube all the time in a small window in the bottom right corner in the Game View window while the game is running. In this camera Culling Mask i selected only the CameraLayer and unselected the rest. So in this camera in the Culling Mask i see: CameraLayer.
But when i'm running the game i don't see the Camera under the Cube at all.
In the screenshot i marked in black where should the Camera under the Cube should be and display the Cube:
Upvotes: 2
Views: 5402
Reputation: 11916
1) Create a Canvas
as child of your first Camera then create a RawImage
as a child of this newly created Canvas
.
This is this Image that will render your second camera video so move it at the bottom right of the view of your first camera.
2) Then Create a RenderTexture
and assign it to the Texture
property of the RawImage
you just created
3) And finally assign this RenderTexture
to the Target Texture
property of your second Camera.
This Target Texture will be used by Unity as a buffer Texture for your Camera. Your scene should now look like this:
Upvotes: 13