The Code plays an Attack Animation (Sequence) if the cooldown timer hits 0 and "Q" is pressed. The problem is, that I dont know how to delete the sequence after it has finished its animation of 12 Frames. If I use "Layer_destroy_sequence(seq)" right after playing it, it gets deleted before the 12 Frames are played. If I do not destroy it, the game starts lagging after just a few sequence plays. If I try to destroy it at the beginning of the script, I get an error message, saying, that it cannot destroy a sequence that doesnt exist.

Destroy Sequence after being played in Game Maker
25 Views Asked by RetroAnt At
1
I fixed the issue myself by:
removing the temporary var seq and using a variable thats created with the Object itself
Have the attack_animation be declared a value when the conditions are met:
Have the attack animation deleted as soon as its time of 12 frames ends using