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