Help with making an animation play for X amount of seconds?

I was wondering if anybody new any code for making an animation play for a set number of seconds (or frames) then stop? Also if you could make the animation start mid way through at a set point? Thank you in advance for any help :slight_smile:

Write the code yourself - something like:

animation.Play("dance");
yield WaitForSeconds(5.0);
animation.Stop("dance");

Of course, you should understand that code before you try to just copy-and-paste it randomly into your project. In particular, understand yield.