1. Hey! Guest! The 33rd GMC Jam will take place between May 23rd, 12:00 UTC (Friday noon) and May 27th, 12:00 UTC (Monday noon). Why not join in! Click here to find out more!
    Dismiss Notice

Attack animation not working, help

Discussion in 'Programming' started by Quirk14, May 14, 2019 at 4:31 PM.

  1. Quirk14

    Quirk14 Member

    Joined:
    Tuesday
    Posts:
    3
    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;
    }
     
    Kezarus likes this.
  2. Kezarus

    Kezarus Member

    Joined:
    Jan 14, 2018
    Posts:
    99
    Quirk14 likes this.
  3. Quirk14

    Quirk14 Member

    Joined:
    Tuesday
    Posts:
    3
    Kezarus likes this.
  4. TsukaYuriko

    TsukaYuriko Q&A Spawn Camper Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    1,253
    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 and Kezarus like this.
  5. Quirk14

    Quirk14 Member

    Joined:
    Tuesday
    Posts:
    3
    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!
     
    Kezarus likes this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice