Fatal loop bug in the game

Greetings,
So I have working on my first game and it’s like 80% complete I was positive everything is working correctly however during testing with enemies I encountered a fatal bug that potentialy break the game.
This is it how it goes if the charcters attack and get interrupted at the begining of the animation the character goes into a loop of attacking non stop basically looping the custom event for attacking for seemingly no reason. Tested further it works fine when attack get interrupted mid or at the end of the animation only at the very begining when the attack gets interrupted as soon as it starts.
here is the code,



I know this is caveman scripting and I learned of better methods however I can’t just rebuild because that would take a long time and would most likely mess up everything in the project.

I would really apprecitate any input in the matter, thanks.

1 Like

Where do you assign Sword boolean to true and false ?

Also, unrelated but what is this supposed to do
image

In the key event that triggers the animation itself

That detect health loss which triggers the hit event


If you get damaged during this first delay, you are never setting Sword back to false.

1 Like

To be honest it doesn’t do anything so to be cleaned

Wow amazing how could I have not seen that, worked like charm.
Thank you very much.
As for the health code I left it there by mistake since I’m learning as I go.

I gained a new insights as well.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.