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

Attack animation not working, help

Q

Quirk14

Guest
I'm trying to make a command where if I press E on my keyboard, an attack animation will play. But it does not seem to work? Quite new to programming and GameMaker etc so go easy on me:

if (keyboard_check_pressed(ord("E")))
{
sprite_index = spr_playerattack;
image_speed = 20;
}
 

TsukaYuriko

☄️
Forum Staff
Moderator
Verify that the code in question is actually running.

Also pay attention to the speed setting you defined in your sprite's properties - this not only affects the animation speed of the sprite in the IDE, but also in the game.
 
Q

Quirk14

Guest
Verify that the code in question is actually running.

Also pay attention to the speed setting you defined in your sprite's properties - this not only affects the animation speed of the sprite in the IDE, but also in the game.
I got it to work! I looked at my code and realised the program I guess was prioritizing the idle animation. But thanks for the help!
 
Top