- Home /
Need help with 3d sound
I am having problems with adding 3d sound to my game. This is my first time and I am learning as I go so it is probably an obvious answer. What i did was I added the audio source component to a gameObject and added audio listener to another gameObject. I didn't change any of the settings accept I set the max distance of the auido source so that it didn't reach the audio listener. When I test it I always hear the sound even though the max distance source doesn't reach my listener. I've tested if the 3d effects work and it seems they do. I've come to the conclusion that the 3d works, but the sound gets played in the backround regardless of how I set the settings. I can't remove the background noise without disabling the 3d sound. I'm completely lost.
extra information: My game is 2d and the audio clip is attached to sprites.
$$anonymous$$ake sure your sound file is not marked as 2D
Answer by fifthknotch · Mar 08, 2014 at 04:04 AM
3D sound does not stop at the max distance if you are using logarithmic rolloff (the default volume rolloff on the audio source component). Change that to linear rolloff or create a custom rolloff and this should solve your problem.
Answer by Firedan1176 · Mar 08, 2014 at 05:48 AM
I think the better question is what are you trying to accomplish? Is the audio listener going to be moving? Make sure on the audio clip in your assets folder is set to a 3D sound. Under the audio source in the inspector, there should be settings with a graph for the distance. Make sure that's also accustomed. Sorry if this didn't help. I still don't see how this would be causing issues. If you tell me what you're trying to go for, I may be able to help in another alternative.
Your answer
![](https://koobas.hobune.stream/wayback/20220613135658im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Make Sound Effects Not Audible Unless Near Them 2d? 1 Answer
Sound volume: How to ignore distance between source and listener? 2 Answers
Pitch changes when i get closer to object with audio source 1 Answer
3d Sound not working? 1 Answer
What does 'float[] sample' in GetOutputData represent? 2 Answers