- Home /
Question by
Flisijn · Mar 28, 2013 at 11:07 AM ·
cameraanimationssmoothtransitioncrossfade
Camera animations transition smoothly?
I want my main camera to do the "Camera_WhileRunning" animation while running (pressing left shift). I also created an idle animation for the camera so I could use the animation.CrossFade but the script is not working at all. The camera can only be moved along Y and the animation is not fading over to the other one. Can someone help me out?
The camera animations are playing on a gameobject which is a child of the Player and the parent of the Main camera.
var animObject : GameObject;
var running : boolean = false;
function Start() {
running = false;
}
function Update() {
if(running == false) {
animObject.animation.CrossFade("Camera_Idle");
}
if(Input.GetKeyDown("left shift")) {
running = true;
animObject.animation.CrossFade("Camera_WhileRunning");
} else {
running = false;
}
}
Comment