2
$\begingroup$

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

$\endgroup$
1
  • $\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
    Commented May 9, 2016 at 23:29

1 Answer 1

1
$\begingroup$

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

$\endgroup$
1
  • $\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$ Commented May 9, 2016 at 0:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .