Trouble with Enemy Death State and Sound

I’ve searched and can’t find a solution for this.
I’m also very new to this engine and am probably missing something obvious.

In the picture, I can make each “Enemy” play a death sound for each one I kill.

But for Enemy_Guard, the sound will only play for the first killed enemy and not the rest. I thought I had set it up so that each instance of Enemy_Guard would execute the death sound. Where am I going wrong?

Trigger once inside repeat for each works only for ONE object

All conditions in events are by default AND
Using AND outside of OR changes nothing

1 Like

I’m not exactly sure what any of that means.
But thank you for a quick answer.

You have for example vent

Condition
Enemy is in collision with wall
Trigger once

Action
Play deflect sound

So when enemy touches wall you added trigger once so sound is played only once and don’t spam each frame

IF you now have same exact setup under repeat for each object (enemy)

Then trigger once will work only for one enemy
BUT for rest it will not
Rest enemies will spam sound each frame when they touch the wall

Cause trigger once inside repeat for each works only for one object

You could

Repeat for each Enemy
Condition
Enemy opacity = 255
Enemy is in collision with wall

Action
Change Enemy opacity set to 254
Play sound

Condition
INVERTED Enemy is in collision with wall

Action
Change Enemy opacity set to 255

That is how you can fake trigger once for each enemy

Ok this makes sense. Thank you for insight. I’ll see if I can get it working now.

1 Like