• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

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