- Home /
Other
Help! Sounds won't play when changing scene
Hi! So, my team and I have been working on a game for a few weeks now, and we're working on implementing basic UI sound effects, such as a click sound when pressing a button. However, all of these buttons also change the scene, and the sound won't play as a result.
I know the sound is functional, because with buttons that don't change the scene, the sound plays. Only the buttons that call the ChangeScene script don't play the sound. My assumption was that because the object is no longer in the scene, the sound is cut off. There is a slight delay at the beginning of the sound clip, so I felt like this was a possibility. I wasn't sure though, so I figured I'd ask.
Thank you for helping, or even just being willing to! Hopefully I explained the issue clearly enough, haha. My team is new to Unity, so I'm sure this is a simple issue to fix, we're just young developers. Thanks again!
Answer by Laurence_B · Oct 04, 2017 at 08:03 PM
The button should still play the sound. You could of course play the sound in the Awake() function. That way it will play it every time the scene loads.
Again the buttons should actually play the sound
So, after tinkering a bit, I discovered that it was playing the sound. But the delay was causing it to seem as if it wasn't, because the clip stopped playing once the button was no longer in the scene, as the button press is what actually triggers the scene change
Follow this Question
Related Questions
Issue adding UI Button Unity 5 1 Answer