|
This script is not working.
The script disables the camera but does not enable it afterwards.
(comments are locked)
|
(comments are locked)
|
|
I have written a script to switch between any no of camera's ***************************** ***************************** 1. Attach this script to any game object 2. In the inspector window set the no of camera's you have in Camera's Variable 3. Drag the camera's game objects and you are done ***************************** ***************************** *****************************/ var cameras:GameObject[]; private var camId:int = 0; function Update () { if(Input.GetKeyDown("c")){ switchCamera(); } } function switchCamera(){ camId++; if(camId < cameras.Length){ cameras[camId-1].gameObject.active = false; } else{ camId = 0; cameras[cameras.Length-1].gameObject.active = false; } cameras[camId].gameObject.active = true; }
(comments are locked)
|

format your code properly and don't demand help asap, if you are that desperate look up the script you are using and learn to fix it yourself.
You'll need to explain exactly what you want the script to do. Bobadebob's solution will switch the camera if you have another collision after the animation has ended, but I'm guessing that you want it to switch back to the main camera automatically once the animation is done - for that, you need a coroutine.
i think marowi is right edited post to conform