Help with making a single 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:

animation.Play(“walk”);
yield WaitForSeconds(2);
animation.Stop(“walk”);

That’s probably the easiest way, unless you needed something dynamic and robust. :slight_smile:

to start mid way try something like:

animation[“walk”].time = animation[“walk”].length / 2.0f;