[SOLVED] Triggering a sound file only once on collision

I just finished the introductory platformer tutorial and I’m trying to add features to it to continue learning.

I created a .wav sound file to use when the player activates a checkpoint. I created a scene event to check for collision between player1 sprite and the checkpoint sprite and set the action to play the sound file.

You can probably see where this is going… Because the checkpoint sprite isn’t destroyed the collision keeps triggering every frame and therefore the sound file is triggered every frame.

How can I tell it to play the sound file only on the initial frame of the collision?

Use the “Trigger once” condition :slight_smile:
Maybe you also want a variable that you set from 0 to 1. So the checkpoint only makes sound when activating the first time.
You can also make an invisible checkpoint hitbox object, that will be deleted after the first touch.

1 Like

Awesome. All great advice. Thanks, Jack.