- Home /
Trouble switching cameras
I'm trying to create a script that switches between cameras but when I run this code nothing happens. BTW I'm not getting any errors either - simply nothing happens.
Can anyone spot any flaws with what I've done so far.
var camera1 : Camera; var camera2 : Camera;
function Start () {
camera1.enabled = false;
camera2.enabled = true; }
function OnGUI () { if (GUI.Button (Rect (10,10,150,100), "Play Animation")) { camera1.enabled = false; camera2.enabled = true; animation.Play ("Camflyby"); } }
Answer by e-bonneville · Feb 14, 2011 at 10:10 PM
Enable camera1 and disable camera2 in your GUI button, not the other way around.
Your answer
Follow this Question
Related Questions
Multiple Camera Switching 1 Answer
switch between cameras in javascript? 2 Answers
Cannot switch cameras!!! Help ASAP!!! 1 Answer
Camera switching trouble 2 Answers
Camera Switched for Smartphone 0 Answers