Making a clear damage animation

So I am trying to make it so that when an enemy takes damage, that is cancels what they are doing and plays an animation that I have called “take hit” (which is your sort of typical stagger with a white flash) just so that the player knows they got successfully hit the enemy. However when I was testing it, I was running into trouble of overlapping animations, and the animation for taking a hit just not playing. Code for the skeleton enemy below.

I suggest to look at your if animation finished condition.(2nd screenshot)
I would add if enemy animation= attack
and probably a trigger once too

Even your player collisio with skeleton hit box needs a trigger once,also be wary that u are deleting skeleton hitbox at each frame.

Same with player hit check.

In the end,better learn more about trigger once… :books:

Thanks for the reply, I got it working.

1 Like