I have camera1 and camera2 with two different rotating behaviors respectively in one scene. When the scene runs, camera1 is activated and start rotating and camera2 remains dead. When I activate the camera2, it starts doing its job, camera1 is deactivate but it remains to its latest position. It will continue its rotation from latest position when I re-activate it.
How to restart the camera1 to its initial position when I re-activate it again?
Codes below:
var camera1 : Camera; //set to camera type1
var camera2 : Camera; //set to camera type2
function Start () {
camera1.gameObject.active = true;
camera2.gameObject.active = false;
}
function Update () {
if (Input.GetKeyDown ("2")){
camera1.gameObject.active = false;
camera2.gameObject.active = true;
}
if (Input.GetKeyDown ("1")){
camera1.gameObject.active = true;
camera2.gameObject.active = false;
}
}