At the moment I am trying to make a sound play once during a collision.
The collision doesn't stop player speed, but rather the player can "run" through the collision box.
This means that the collision function returns true for several frames in the game.
Whilst can get a collision to play a sound, because the function is returning true for several frames the sound bite keeps restarting every frame.
Could someone please explain how I could make it so that
Whilst collision = True
Sfx plays all the way through(only once though)
I am currently trial and erroring my way through this, but I wondered if I could cut that a little shorter by asking a question on here. I did try searching online for tutorials regarding this but they either make a sound effect play when a button is pressed, or something that doesn't necessarily apply to a situation like this.
[Please log in to post a comment]