Attack animation

0 favourites
  • 8 posts
From the Asset Store
Zombie attack is a survival game, where you have 2 types of games: Killer and survival.
  • So I'm trying to get my attack animation to work, it only works on "Key Down" in which it plays the animation over and over as long as the key is down and only plays it as long as the key is down, which means it cuts off before finishing. If I change the condition to "Key Pressed" it just resets the idle animation, making it stutter. How can I make it so that it will play fully on one key press?


  • You can set up "states" for animation. On key press, change state to "attacking". Use trigger once while true to play the animation based on the state. Use another trigger event for when your animation completes or a timer to change your state back to idle.

  • so for "states" would I be using instance variables?

  • okay so I tried what I think you meant (using instance variables, on keypress add to the variable, when variable = 1, set anim, on anim fin subtract from variable) but it just freezes on the first frame without playing the whole animation. and if I do a timer to end the variable it still just plays the first frame.

  • Are you using the set animation action rather than set frame? Are your animations set up correctly? Speed not 0, correct frames?

  • Yes, I'm using set animation, and the animation speed is 10

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • If it helps, I have figured out that moving a little while it's frozen makes it play for a couple of frames and then immediately goes back to the first frame and re-freezes

  • Alright so my Idle animation was completely screwing with it somehow, once I took out the initial way that idle would play, the attack worked just fine, Thank you for your help on saying to use the "states" for it, that helped me figure it out

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)