I would like to make an event that when the player clicked a keyboard button (say f5) the view will be changed from (mainCamera) to (upCamera).
notice:
mainCamera position is (0,0,49) and rotation is (0,0,0)
upCamera position is (0,31,0) and rotation is (90,0,0)
var camera1:Camera;
var camera2:Camera;
function Start () {
camera1.enabled=true;
camera2.enabled=false;
}
function Update () {
if (Input.GetKey(KeyCode.F5)){
Changecam();
}
}
function Changecam () {
if (camera1.enabled==true){
camera1.enabled=false;
camera2.enabled=true;
}
else {
camera1.enabled=true;
camera2.enabled=false;
}
}
i’ve write this code at moment,some errors is possible,sorry.