Hey guys, I’ve been tinkering with GDevelop for a few weeks now (and it’s awesome by the way) and most problems I’ve managed to solve myself or with a simple search.
This latest problem has me stumped and nothing shows up when I search. Search results only seem to show problems with the animation only playing one frame. I managed to sort that problem but now my character will attack once and then the attack button does nothing until I press another key with a different animation such as walk or jump.
I’ve tried many things like disabling all other code to find a conflict but it’s not any of the other code causing the problem.
My code for the attack is simply “key is pressed - Change animation to attack”
Do I need to do something else to reset the animation so it will play again. Like I said above, if I walk just a single step or press the jump button once it will then allow me to attack again!
I’m going to assume the loop box of the attack animation is unchecked to prevent it repeatedly attacking with one button press. The issue is that if you use a “change animation” action but the animation is still the same, then GDevelop doesn’t reset it. It just keeps playing the current animation.
The fix is to add an action, after you set the animation, which sets the current frame: