I've set up two buttons to switch between cameras.
Cam1 has an animation attached to it. Herein lies the problem. When I switch to Cam1 the animation doesn't start playing. How do I get this to happen?
If I set it up to play automatically, it camera starts moving when the game starts, and thats not what I want. I only want the camera to start moving when I press "1".
var cam1 : Camera;
var cam2 : Camera;
function Update () {
if(Input.GetKeyDown("1")){
cam1.enabled = true;
cam2.enabled = false;
}
if(Input.GetKeyDown("2")){
cam1.enabled = false;
cam2.enabled = true;
}
}
cam1.animation.Play();
OR
cam1.animation.Play("theAnimationName");