Can I Change The Camera That Is Used In Play Mode

Hi All

I have a few cameras in My Game
But when certain animations and events happen, I want the camera that is used during the event to change
In most cases it is the user clicking a button on the GUI that will start the animation/event

Is this possible

Thanks
Michael

Could you extend, to what exaclty the camera should change? Simply changing the active camera to an other camera? This is simple just disable the currrent camera and enable the new camera (enabled property of the camera component).

Ok, that simple.
Just wondering, is there an order. I think i will end up with a Main Camera and maybe 4-5 others.
Say I have got names Like the following
Main Camera
Camera 2
Camera 3
Camera Inside Door
Camera 5

I know the default is Unity will look for a camera called “Main Camera” and if it finds it, it will make it current. But if i want
to make “Camera Inside Door” current, will i have to set enable to false on the other 4 cameras or does unity have some
sort of ordering or is it just the first one in the Heirarchy

Thanks again

Unity renders using every Camera that is enabled. The order in which they render is determined by the camera’s Depth. http://docs.unity3d.com/Documentation/Components/class-Camera.html

turn the cameras off and on when desired

MainCamera.enabled = false;
Camera2.enabled = true;

Ok thanks everyone
i will probably use the enabled
although i didn’t know about the depth setting, im sure it will come in useful too

Thanks