Stopping an animation from looping at the end?

Hello! So I basically want to stop an animation from looping, but first I want it to finish it's last run, instead of just stopping wherever it happens to be though it. After this, I need to play a different animation. Could somebody tell me how I might go about scripting this? Thank you! -Keavon

I have seen others suggesting to use CrossFade/CrossFadeQueued, but they don’t get the desired effect. I do not want to cross fade nor blend, I want the looping animation to finish its loop and then play the next animation. Eventually, I found a good way to do it. Just in case anyone needs it, here it is:

animation["LoopingAnimation"].wrapMode = WrapMode.Once;

Simple as that. Remember to reset the wrap mode to WrapMode.Loop if you later need to play the looping animation again.

Work that in, then after the yield, play whatever animation you want...

=) All the best!

You can use Animation.CrossFadeQueued to play several animations in a row.

If you don't really understand the basics, I suggest you check out the character-animation example project and the 3d-platform-game tutorial, and read about how the animation in Unity works from the docs.

Basically, if I remember correctly, you do something like:

animation.CrossFadeQueued("shoot", 0.3, QueueMode.PlayNow);
animation.CrossFadeQueued("jump", 0.3, QueueMode.CompleteOthers);
animation.CrossFadeQueued("crawn", 0.3, QueueMode.CompleteOthers);