Problem with forces (SOLVED)

Greetings,
In my game, I have an enemy. When the enemy dies, I want it to leap in the air a bit, and then fall offscreen. Here is the setup I used for this (Bottom code, above the pink group):

Now, there is one problem with this code as it is currently. When I kill the first enemy, it does exactly the thing I want it to. However, when the dead enemy is still onscreen, the second enemy I kill doesn’t leap, but rather just falls. The enemies only do a small hop upon death if there are no other dead enemies on screen.
Removing Trigger Once is a bad idea. If Trigger Once is removed, the enemies quickly fly up to space when they die since the force is constantly active.
How do I make sure that each enemy’s death animation works the same way? You know, like how to I make the downwards force (The force that makes them fall) constant, while making sure the force that makes them leap stays active just once for each enemy?
Thanks ^^

If an event only works on one object you probably need to make the event that only works on one object a for each object event

About that, prior to this screenshot, I actually did have a For Each event. I removed it to experiment and forgot to put it back.
Otherwise, For Each surprisingly doesn’t make a difference. I just put it back to test and nothing changed.

Just gonna bump this

The answer is in the question :slight_smile:
But remember the problem of trigger once with for each from your previous topic, so use an instance variable instead of the trigger once.

Thanks, the instance variables worked ^^

1 Like