- Home /
Sound plays even though Play On Awake is unticked
Hi guys,
I have a weird problem where a newly added sound plays at the start of the game even though Play On Awake is unticked. Also I added a line in the Start()-function in my script "audioSystem.sound.Stop()" if that would help, but no such luck.
Google didn't help with this issue, or maybe I didn't use the right search terms. Can anyone help me?
Is this happening on the device or in the editor as well? I've seen a bug like this on ipads that I've yet to figure out.
I haven't tested on the device yet, but the web player build has the same problem.
Hi there, does anybody know an efficient fix for this?
Answer by Pablouh · Aug 14, 2014 at 11:39 AM
Well finally I got rid of the sound playing at the start. I just removed the sound file from the project and re-added it. Some kind of weird bug was going on there. Thanks for your help, guys :)
Answer by gamlin777 · Aug 13, 2014 at 10:17 PM
Make sure there are no other instances of the object in the scene.
Check to see if the object is enabled (ticked) at runtime.
Comment out all audioSystem.sound.Play() in your scripts, then enable the one by one to see if a function with .Play() inside is being called prematurely.
Sorry for the vague answers, it's all I got with the information provided. Good luck :)
I triple checked - there are no other instances of the object in the scene.
I'm not sure what you mean by ticked at runtime.. When running the game the "sound.enabled = true". If I make it "false" in the Start()-function it doesn't stop the sound from playing.
Commenting out all the sound.Play() lines in the game doesn't stop the sound from playing.
Thanks for your answer!
Answer by SwissCore · Jul 14, 2018 at 01:25 PM
I know, this is an old Thread, but I have the same issue in my Project (Unity 2018.2), re-adding the Audio-clip did not solve the problem for me. The audiosource.Play() function is only called when a UI button is clicked, which is not the case at start of the game. If I disable the audio source the sound does not play, so its that audio source which gets triggered at start. Any ideas?
Solved it but not in a very clean way. disabled Audiosource on Awake and invoke an enable function with a delay of 0.15f. Works, but is not the best way. I hope somebody come up with a cleaner way to solve it.
Your answer