How do I add a sound to the start of my game so it only plays once?

  • $\begingroup$ After reading your comment to Tim's answer, you'll need to upload your .blend. Using blend-exchange.giantcowfilms.com upload your .blend so people can help you better. And then edit your post with the link. Thanks. $\endgroup$ – Luka ash May 9 '16 at 23:29

I'm fairly new to the game engine, but I was able to work this out so I will add my solution. Add a sensor and set to always>once, and then add a controller. The controller will be be an and controller. Finally, an actuator, which will hold the sound file. Set it to Sound>sound and the mode should be Play stop.

This should work with a speaker or empty as well as a mesh object if you prefer, I tested on a uv sphere with the shortest sound I could find on my PC, and it works. It will play once only upon pressing P.

Your logic bricks will look something like this:

enter image description here

|improve this answer|||||
  • $\begingroup$ Hi, and thanks for your answer. I was already doing it the way you describe, but Blender isn't playing the whole sound file and misses the beginning. I tried adding 1.5 seconds of silence to the start of the file to give Blender some time to load it, but it doesn't change anything. I have a second sound file called by another Always that plays in a continuous loop throughout the game, and I thought it might be interfering with the first file. $\endgroup$ – Anthony Forwood May 9 '16 at 0:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.