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

GameMaker Animation only flashes when specified key is pressed.

R

Rika7567

Guest
Alright, so I'm very new to game maker, but most things (with enough digging) I've been able to figure out my self. However this has stumped me.
Basically, I'm attempting to play a attack animation,. I've got it set up so when shift is struck, a animation will play, but the animation only flashes briefly, like for a split second.
I think it has something to do with animation loops, but I'm not sure, any help would be awesome.
Thanks.
 

PlayerOne

Member
1) Welcome to the forums.

2) Please post your code so that we can help you. Ensure when you copy and paste your code into a post you use the code brackets.

3) Since you didn't post any code I can only speculate on your problem. My best guess would be that there is an if statement that is constantly check as true which is showing the current animation before you hit the shift key causing the attack animation to flicker for a second before returning to the last animation.

This is a rather common issue when programming.
 

YellowAfterlife

ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ
Forum Staff
Moderator
My guess that there is code deciding on animation in a Step event (as things commonly are) and this overrides the attack animation by the next frame. In such case one would not override the current animation if it's one of the special ones and reset them in Animation End instead
 
R

Rika7567

Guest
1) Welcome to the forums.

2) Please post your code so that we can help you. Ensure when you copy and paste your code into a post you use the code brackets.

3) Since you didn't post any code I can only speculate on your problem. My best guess would be that there is an if statement that is constantly check as true which is showing the current animation before you hit the shift key causing the attack animation to flicker for a second before returning to the last animation.

This is a rather common issue when programming.

Thanks, and yes your absolutely right about other animations being decided in my step event. I have a running and idle animation decided in my step event.
here is my code:

[if (Key_attack)
{
hsp = (hsp < 1);
vsp = (vsp < 1);
sprite_index = Sword_rough;
}]
 

PlayerOne

Member
Thanks, and yes your absolutely right about other animations being decided in my step event. I have a running and idle animation decided in my step event.
here is my code:

[if (Key_attack)
{
hsp = (hsp < 1);
vsp = (vsp < 1);
sprite_index = Sword_rough;
}]
Can you post your entire movement code or is this all of it?
 
Top