- Home /
PlayQueued doesn't work inside a for loop?
Hi
Could anyone explain this rather odd behaviour I'm seeing with PlayQueued? It seems that if I call PlayQueued explicitly for each of my animations, i.e.:
character.animation.PlayQueued("anim1");
character.animation.PlayQueued("anim2");
then I get my two animations played in sequence as expected. But if I simply replace this with:
var anim: AnimationState;
for (anim in character.animation)
{
character.animation.PlayQueued(anim.name);
}
then Unity hangs on hitting Play! Weirdly, using character.animation.Play instead of character.animation.PlayQueued in the for loop above is fine. (As expected, the result of this is effectively to only play the last animation in the set, since each invocation of Play in the loop will immediately stop each of the other previous animations, but at least it doesn't cause Unity to hang).
Any clues?
Your answer
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Update iTween Path at Runtime 1 Answer
Animation within Unity 1 Answer
Animation by Scripting point A to B 1 Answer