My char has 4 types of animations:
walk idle handUp handDown. Here’s my animation script:
function Start ()
{
handUp = animation["handUp"];
handDown = animation["handDown"];
idle = animation["idle"];
run = animation["run"];
handUp.layer = 1;
handDown.layer = 2;
idle.layer = 0;
run.layer = 0;
handUp.blendMode = AnimationBlendMode.Additive;
handDown.blendMode = AnimationBlendMode.Additive;
handUp.wrapMode = WrapMode.ClampForever;
handDown.wrapMode = WrapMode.ClampForever;
animation.Stop();
}
function Update () {
if (Input.GetAxis("Vertical") > 0.1)
animation.CrossFade("run");
else
animation.CrossFade("idle");
if (Input.GetAxis("Vertical") < -0.1)
animation.CrossFade("run");
if (Mathf.Abs(Input.GetAxis("Horizontal")) > 0.1)
animation.CrossFade("run");
}
function picAnimation(){
animation.CrossFade("handUp");
}
function throwAnimation(){
animation.CrossFade("handDown");
}
my problem is that pick/throw animation is played only for the first time. When i’m calling picAnimation/throwAnimation again nothing happens.