Repeat Animation set amount of times

Hi,

I’m trying to loop an animation x amount of times.

For example:
//Play animation 5 times
animation.Play(“animation”, 5);

Not sure how to go about doing so, as WrapMode seems to either play once else loop forever.

Thanks in advance.

for(int count = 1; count <= 5; count++)
{
animation.PlayQueued(“animation”);
}

this should do it :slight_smile:

in “count <= 5” replace 5 with the amount that you need

for me it doesn’t work for loop, it just repeating itself infinite and it’s even too quickly does the loop

can you modify the animation to call a function at the end of the animation - which would basically be a counter, and the stop it etc if it gets to the number you want?

naturally this only works in the animation is editable and not read only etc.