• 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!

Legacy GM Animation not playing all the way through - [SOLVED]

S

Silver_Mantis

Guest
Hello GM Community,

A game I'm currently working on has a minor bug that is puzzling me.
I have an educated guess on what the problem might be, but I'm having a hard time fixin' it.

Here's the deal, (Or what I think the problem is):
When my character is in the "Move" state and I attack, the attack sprite animates from the same frame number as my walk frame.
So if I'm walking along, and I attack on frame 2 of the walking animation, the attack animation continues from frame 2 instead of starting from 0.

Here is what the bug looks like:


Here is the full animation:


If I catch the walk animation on (what seems to be) frame 0 it plays all the way through even when I'm walking.

Here is my scr_Attack_State code:


And here is my obj_Player Animation End code:


Is there a way to force the animation to play from frame 0 every time it starts up?

Any help would be greatly appreciated. I've been trying to fix this for over an hour now.
 
S

Silver_Mantis

Guest
I tried to change the sprite_index to 0 within the scr_Attack_State right after the sprite_index is changed, but it just freezes on that frame and doesn't play all the way through.
Did you have an example of how it might work within my code?

EDIT:

YES THAT WORKED. Life saver JackTurbo!
I actually didn't use it within the State, but the check for the Left Mouse Button. Thank you!
 
Top