I am using the built in 1st person controller and am trying to script for a camera change from the player camera to a world map camera, using this script:
var camera1 : Camera;
var camera2 : Camera;
function Start () {
camera1.enabled = true;
camera2.enabled = false;
}
function Update () {
if (Input.GetKeyDown ("2")){
camera1.enabled = false;
camera2.enabled = true;
}
if (Input.GetKeyDown ("1")){
camera1.enabled = true;
camera2.enabled = false;
}
}
This is not working however. I am getting the world map view, but it does not change back to the player camera when I click the button again. I think it is because the first person camera is not disabling, but I am not sure. Please help.