Help: Problem with my Animations

hi,

I have a problem with my animations.

I wanted to do a croosFade to the same animation. So I chose to use the CrossFadeQueued, but, here is a problem… the animations (attack1 and Idle) are in normal speed, but the others are very fast (attack2, attack3).

I tried to do animation[“attack2”].speed = 0.5, but it does not work. I’m using Unity 3.3

what happens?

my script (animations):

function Start () {
    animation.wrapMode = WrapMode.Loop;
    animation["attack1"].wrapMode = WrapMode.Once;
    animation.Stop ();
    Idle();
}

function Idle() {
    animation.CrossFade("idle", 0.3);
}

function attack () {
    animation["attack1 "].speed = 0.7;
    animation.CrossFadeQueued("attack1", 0.3, QueueMode.PlayNow);
}

function attack2 () {
    animation["attack2"].speed = 0.5;
    animation.CrossFadeQueued("attack2", 0.3, QueueMode.PlayNow);
}

function attack3 () {
    animation["attack3"].speed = 0.5;
    animation.CrossFadeQueued("attack3", 0.3, QueueMode.PlayNow);
}

thanks

The CrossFadeQueued function actually returns an AnimationState which is specific to the queued item (this is not the same AnimationState as the one you get from animation[“xxx”]). If you store the returned value, you can use it to set the speed and other properties of the AnimationState in the queue.

andeeee,

Thank you so much… I’ll look at it today, thanks!

SOLVED.

I just had to do this:

function attack () {
    var atk1 = animation.CrossFadeQueued("attack1", 0.3, QueueMode.PlayNow);
    atk1.speed = 0.7;
}