Add camera for "gamefield" window (SOLVED)

Hi guys,

This is my first post here and I’m a beginner in all this who really needs your help as I just can’t figure out how to put this in a question good enough to find the answer on Google (hence the title to this post). I’m gonna do my best to explain here.

I’ve currently started my first project which is made for mobile and created an image-template to display the “screen” together with graphical buttons and logos etc. (which will be added further on so the image will basically just be a background later on).

In the center of the screen I want to display a square window in which the game itself will be played. Kind of like the Super Gameboy for SNES, where the Gameboy-game was played in a window on the center of the screen and around it a background was displayed.

Been trying to solve this with added cameras, RenderTextures and been following guides for minimaps etc. as they are kind of similar to this but I just end up stuck and find it all confusing (haven’t really cracked the logic yet).

I hope you get my idea here and hopefully can point me in the right direction as I get stuck whatever I do…

Best regards

// Peter

[SOLVED] Nvm, I just solved it! Let me explain further how I set this up and how I solved it in case someone else runs into this in the future.

I more or less used the procedure that I found here but my problem was that the second camera apperad on the same layer as the RenderTexture. When I played around and turned on 3D view I figured out that the Canvas followed the same depth as the Main Camera.

The solution was to separate the Canvas from the Main Camera and set Pos Z to 0 (as the Main Camera had Pos Z -10). Now the Main Camera displays both the UI, the RenderTexture and the content that the second camera is focusing on.