• Hey! Guest! The 37th GMC Jam will take place between May 28th, 12:00 UTC and June 1st, 12:00 UTC. Why not join in! Click here to find out more!

Attack animation not working, help

Quirk14

Member
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;
}
 

Quirk14

Member

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.
 

Quirk14

Member
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