system
1
Okay, here is my problem. I have a simple 2d (actually it’s 3D with an overhead camera, but anyway) I have about 22 cameras going in sequential order and when I click a certain button on the GUi, it switches to the next one. But nothing works and there is no switching of cameras. It should work that when you start at the Main Camera (camera 1)and then when you click the button (which is GUI) you go to the next one (cam 2), but nothing works. Can anyone at least point me in the right direction of what to do?
Grady
2
The standard procedure for switching between cameras when pressing the left mouse button would be something like this:
var camera1 : Camera;
var camera2 : Camera;
function Start(){
camera1.enabled = true;
camera2.enabled = false;
}
function Update(){
if(Input.GetButonDown("Fire1")){
if(camera1.enabled == true){
camera1.enabled = false;
camera2.enabled = true;
}
else{
camera1.enabled = true;
camera2.enabled = false;
}
}
}
Drag the main camera, (the one that will start active) into the `camera1` variable. Then drag the other one into the `camera2` variable. I haven't tested this, but it should work, if it doesn't, just comment back and I will fix it, I took a bit of a shortcut that I normally don't, but it should work as is!!!!!
-Grady