- Home /
Wrong choice of main camera among multiple cameras
Hello! I often run into the following issue. I have multiple cameras in in my scene. All except the one tagged MainCamera are Untagged. The problem is that for some of the untagged cameras the scene renders in-game not through the MainCamera but through them. I have to disable or delete them in order to render through the main camera.
Yet other untagged cameras work fine and don't cause issues. I have tried moving the cameras up and down the hierarchy, changing their names and assigning them different tags but the problem persists.
This is getting quite annoying because I need the auxiliary cameras for some calculations and don't want them disabled.
Any ideas?
Have you tried adjusting their depths so that they draw over/under eachother?
The draw order of my objects is specifically set in their shaders through the Queue tag. The thing is, all objects are drawn properly, without z-fighting or any depth-related attributes, but through the wrong camera. The cameras do not render over one another and even if they do - why do they do it if only one of them is $$anonymous$$ainCamera?
Answer by StylizeR · Jan 09, 2012 at 09:31 AM
As Lo0NuhtiK said, I think you just have to go to the camera settings, and set the depth of the problematic camera to a lower number than the main camera.
MainCamera is "just a name for the camera".. This doesn't mean it will be rendered on-screen no mather what.
You can also set the camera "Normalized View Port Rect" weigth & height to 0, so it won't show up on your screen.
It worked! It was the depth setting after all, I haven't noticed it before. Thank you very much, Lo0Nuhti$$anonymous$$ and StylizeR!