- Home /
Unity only one sound works per scene
Whenever I drag in an audio clip from a folder and play it with scripts or with play on awake, it doesn't make any sound unless it was the first one ever put in the scene.
This has happened to me for every project I have done. Whenever I add a soundtrack, it blocks out all other sounds unless it is gone or muted. I have already asked this question once and haven't gotten a single response after waiting a month.
Sorry for the grumpiness, if you need more information to diagnose the problem please ask for it.
here's how audio works in unity
1) $$anonymous$$ake sure you have only one "AudioListner" active at a time (just keep one AudioListner component on the camera object) 2)Add an "AudioSource" component to a gameObject which should be active on gameplay 3)In the AudioSource,tick play on awake or play the audiosource through the script. 4)$$anonymous$$ake sure on the audio clip file untick the "3D Sound" unless you want to use the audioclip as a3d sound.
If this doesnt help please show some screen shots of the "AudioSource" assigned to the gameobject and the scripts you are using to play the audio file
$$anonymous$$, you definitely need to be more specific with your question. If you use script - show it (at least in crucial parts). Where you add a soundtrack? To the same script or Audio Source?
Answer by kurotatsu · Sep 13, 2014 at 05:45 AM
If this is the case, and you want to hear the sound from anywhere in the level, I would go to each sound clip in the project tab and uncheck the 3d sound box.
Then distance isn't considered when it is played, no matter which GO it is on.
Just a thought, hope it helps.
Answer by Joseph Lerner · Sep 13, 2014 at 04:11 AM
Well I think I found it why the music wasn't working. I make the music on a seperate GO and the music volume scales with the GO distance. The GO was too far away to hear. I heard the music was slightly audible and listened to it get louder the closer I got. Well I hope this is useful if anyone else has that problem. Hope I didn't waste your time, this honestly has been a big problem for me for a while and it was just an accident that fixed it.
I won't mark this as the correct answer unless you think its O$$anonymous$$.
Your answer
Follow this Question
Related Questions
Play sound, while press any key 3 Answers
Music stops other sounds from being played? 0 Answers
Play Audio Through Scenes 0 Answers