- Home /
How to set a a Camera as a main camera
Hi
i have a problem with my cameras. i´m making a game like uncharted and when the player presses a button a the cam should switch to another one and shows that the door is open and then switch back to main cam. but when i start my game it switchs to the other cam. how can i set the main camera to be shown when i start the game?
Answer by ZouBi27 · Sep 09, 2013 at 02:03 AM
Enable the camera you want to show and disable all others camera.
camera1.camera.active = false; camera2.camera.active = true;
Don't only use the depth property of the cameras. If you don't disable other cameras you don't use, you'll have twice the draw calls.
Answer by eddyzy · Sep 08, 2013 at 04:02 PM
the camera with the lower depth wil be the first to render.
your main camera will be the one with the lower depth.
this didnt work my main cam has -1 and the other one 0 Edit: The $$anonymous$$ain Cam is the one with the higher depth
sorry my bad is the other way around the camera with the highest depth wil be the first to render. eg one has -1 the other 0
the one with the 0 will render
$$anonymous$$ake sure the tag is also "$$anonymous$$ainCamera"
Yeah it has /nothing/ to do with the camera's depth - it is always the first camera with a tag of $$anonymous$$ainCamera - it will be null if no cameras have that tag.
Now it seems that it is the Depth that tells which camera should be the main.
Your answer