- Home /
Audio disappers after Application.LoadLevel
As background music to my scene, I have an audio source with a 2d audio clip set up to "Play on Awake".
It works great if I start in this scene.
However, if I start unity (or the built executable) in a different scene and transition to this scene via Application.LoadLevel("MyScene") then all the audio disappears - I don't hear anything!
There is a single audio listener on the main camera, and I know it works since I hear the music when I start this scene directly in unity.
I'm not doing anything funky like DontDestroyOnLoad or LoadLevelAdditive.
To illustrate:
Start -> Scene 1 (background music OK)
Start -> Scene 0 (background music OK) -> Scene 1 (music disappears!!)
I'd appreciate any pointers...
Thanks in advance!!
Farq The Orc
Hi FarqTheOrc,
Have you tried creating a new project with just those simple functions? I often find that with simple stuff like that, it is sometimes good to test in a clean environment in case there is something clashing, or in complicated projects it can help give a simpler, clearer picture of what is going on. In fact there have been times that when putting the simple project together I find what I have done wrong before finishing it ;)
Also if you do that and it is still happening, you will have a project file you could share with the community so they can look at it with ease (and you don't reveal your super secret mega game project! lol).
Paul
Hey Paul!
Thanks for the tip. I did what you said and it's definitely not a unity issue. It was, in face (cough cough) - user error!
I had manipulated AudioListener.volume in scene0, preventing the sound in scene1.
All good now! Thx for the advice :)
Great to hear you sorted it Farq. Very rarely is it a Unity error. We humans are inherently faulty ;)
Answer by kiritoCSUCI · May 16, 2018 at 08:07 PM
I am actually having the same issue.,I am actually having the same problem if that helps haha.
Your answer
Follow this Question
Related Questions
How to take a GameObject from A scene to B scene when the GO was instantiated? 1 Answer
What is the standard solution for preserving level data? 0 Answers
How to Make the Game Go to the Next Level When the Music Stops 2 Answers
Mute audio in every scene problem 1 Answer
Networking - 2 Scenes where one i selection and other actual game 2 Answers