var origninalCam : Camera;
var aimCam : Camera;
private var originalCamActivated = true;
function Start(){
originalCam.enabled = true;
aimCam.enabled = false;
function Update(){
if(Input.GetButtonDown("Fire2"){
if(originalCamActivated == true){
originalCam.enabled = false;
aimCam.enabled = true;
originalCamActivated = false;
}
else{
aimcam.enabled = false;
originalCam.enabled = true;
originalCamActivated = true;
}
}
}
And please make sure to remember to format your code by selecting it all and pressing the 101010 button at the top next to the paperclip icon!
Now what you have to do, is drag your normal, starting camera into the originalCam variable, and the aiming camera into the aimCam variable.
Then, you’re ready to go!
I think what you were lacking in your original script was the ability to detect what camera was currently enabled, and to then be able to switch back and forth!
I hope this works for you! If you have any more issues, then just let me know!!!