How to handle enemy animations

hi guys,i 'm having trouble making enemies perform animations.
I would like the enemy to add a constant force towards the player and to play the attack animation when it is close to the player and to stop only when the player is hit by activating the flash.

what happens is that the enemy stops when the attacking boolean variable is activated not allowing collision with the player and that when it is asked to stop for the player’s flash this does not happen.

I know that the problem is related to the distribution of events but I’m having trouble managing them

can someone help me please?

If a player is flashing, you set the enemy animation to idle. But, as the enemy may have moved from its last position by then or be within 32 pixels distance, that idle animation will be overridden in the events that follow it.

I suggest you create a new event with the condition “Player is not flashing”. Add this event straight after the one checking if player is flashing, and put the following as subevents off the “Not flashing” event:

image

1 Like