Stop some enemies and make others move

I need that in the event of the player’s death, some enemies remain still while others choose a point and reach it.
The problem is when the HP = 0 variable is continually recalculated the pick variable.
I am attaching the Screen of the events and links of the project

May need some clarification, are there some enemies that are different than others, such as different sizes or types?
Also in the part where you separate the enemies objects maybe change that to a collision otherwise it may decrease performance

1 Like

Move the HP = 0 condition into its own event and add a trigger once.

Then move the Repeat for each instance of enemies as a subevent of this new event…

1 Like

yes there are more enemies but this event is activated for a few seconds when the player is killed.
I tried adding the damage extension but it doesn’t seem to work anyway…
the enemies activate variable 1 and some 2 but remain stopped. probably caused by the once trigger.
I attach the example file, could you kindly take a look when you have a chance?

Ha, I missed this earlier - It’s the instant force that’s the problem. You could make that a permanent force, but you’d then also have to add a collision event (and ignore that while player is alive) if the game continues playing after the player dies, or use a pathfinding move,

The situation that will arise if you only remove the trigger once is the enemies will just jiggle around.

1 Like

the game continues for a few more seconds and then returns to the main menu.
I just wanted to animate the scene a little after killing the player