Windows How to have moving character stop when attack button is pressed?

gw4

Member
Hello, all! Newbie here and I was looking for some expertise.

Working on a 2-D side scroller. My attack swing animation works fine from an idle position.

I want to make it to where, if he's walking and the attack button is pressed, his walking is stopped long enough for the attack animation and then he can resume moving again.

Right now if I'm holding forward while I press the attack, he begins the attack animation but it is immediately canceled back into the walking animation. I want the attack to briefly cancel the movement.

Any tips? currently using the toolbox format until I get the hang of using the other format.

Thanks for your time!
 

TailBit

Member
when you attack, set a variable to true that shuts down your walking code, and in the "animation end even" you check if attack is true and put it back to false again so your walking code can do its thing
 

gw4

Member
when you attack, set a variable to true that shuts down your walking code, and in the "animation end even" you check if attack is true and put it back to false again so your walking code can do its thing
got it! thanks for the help!
 
Top