- Home /
Using PlayQueued for multiple reverse animations help please!
I've been scouring the forums and answers for hours and can't seem to find out what is going on. I've got a number of animations I want to play forward (WORKS!) with PlayQueued and then reverse those animations and play them in the reverse order (DOESN'T WORK).
I've tried multiple implementations and I find it hard to believe Unity has a bug with this, so I must be doing something wrong.
Multiple animations forward (WORKS!):
for (int i = lastStep + 1; i <= activeStep; i++)
{
AnimationState forward = anim.PlayQueued("Step" + i);
forward.speed = 1.0f;
}
So, the rewind should work with similar code, but all that happens is the first clip plays in reverse perfectly, but then the next 3 clips (amount used for test case) instantly snap into place at the first frame.
Multiple animations rewind (DOESN'T WORK):
for (int r = lastStep; r >= activeStep; r--)
{
AnimationState rewind = anim.PlayQueued("Step" + r);
rewind.speed = -1f;
rewind.time = rewind.length - 0.01f;
}
Any ideas why this last bit doesn't work?
Notes:
I've tried declaring the AnimationState inside the loop, outside, as a global, nothing.
I've tried separating the whole thing so it didn't use a for loop and queued all the animations in reverse manually, nothing.
I've tried setting both time and speed before and after queueing, nothing.
I've searched many articles and questions about reversing the animations, nothing.
I'd rather not use AnimationEvents or separate clips if possible (there might be a lot of clips and doubling them would be inefficient).
My poor head can't take many more hits to the desk, anyone have any ideas?
Thanks!