GML reset animation

JAG

Member
Hi there everyone,

Im making a platformer, I have some jump and dash animations triggered with some scripts I wrote. It seems to me that whenever I set sprite_index to my eg jumping sprite, the animation does not start from the 0th frame.

I tried setting image_index = 0 in my animation end event, but that doesnt seem to do it either. What's the standard way of running an animation, stopping the animation on the last frame, then restarting the animation from the first frame next time it runs?

Thanks!
 

JAG

Member
Cool thanks @TheouAegis, I was trying to do that in an OO way, ie my_sprite.image_index = 0, but it looks like I can only call image_index on the currently-active sprite.

Thanks!
 
Top