Hello again, just a quick fix most likely. For my assignment I have been told I need to have the camera change on mouse click. So far I have figured out how to change the camera with keys ( 1, 2 and 3) but I need to transfer this to mosue clicks and enable it to cycle through. So the first click would change to camera 2, the second click to camera 3 and then the next click back to the first camera and so on. Here is my code so far:
UPDATED CODE THANKS FOR THE HELP SO FAR GUYS
var camera0 : Camera;
var camera1 : Camera;
var camera2 : Camera;
var counter : int = 0;
function Update(){
if (Input.GetMouseButtonDown(0)){
counter++;
}
else if (counter == 3)
{
counter = 0;
}
}
switch ( counter )
{
case 0:
if (counter == 0)
Debug.Log ("This is camera 0");
break;
case 1:
if (counter == 1)
Debug.Log("This is camera 1");
break;
case 2:
if (counter == 2)
Debug.Log ("This is camera 2");
break;
}
Any help/suggestions are much appreciated, thanks!
Addition information:
Script name: Cameras.js
I have tried looking out at other questions but nothing seems to fit what I need.