|
I have two cameras in my scene; one in first person and the other in third person. I want the first person camera (tagged as MainCamera) to be the active camera when the game starts. Once the player hits a trigger, the second camera should then become active. I cannot seem to figure out how to disable the second camera when starting. How do I ensure that only the main camera is active when starting?
(comments are locked)
|
|
Simply set the GameObject inactive in the scene - the little checkbox top-left in the Inspector. Then to swap cameras: If you want to transition between the two cameras, you will be better with just one camera (which you move between two locations). If you´re instantiating prefabs you have to set the ones you don´t want to be active through code as well, because every prefab+it's children gets instantiated as active=true.
Aug 25 '11 at 03:52 PM
Joshua
You can also set just the Camera component to be inactive. That should work for prefabs as well.
Aug 25 '11 at 05:38 PM
sharat
(comments are locked)
|

I'm having a similar problem where the MainCamera tag isn't working for assigning the first camera. My current workaround is to disable all the other cameras so that only one camera component is enabled at a time. Still, I'd like to know if there's a better way to do this.
Both should probably stay tagged MainCamera. This tag is used for Camera.main, and it only finds active cameras.