- Home /
The question is answered, right answer was accepted
Stopping Sounds from Going Through Walls?
I am trying to implement a realistic 3D sound system in my game that will soften sounds that are on the other sides of walls, but also have those sounds wrap around the ends of the wall and approach their normal volume as a player approaches them. Is this anything that might already be supported in Unity, or would I have to find my own way to implement it? And if the latter, is there a common way of doing this?
Answer by Bunny83 · Oct 31, 2017 at 02:29 AM
I haven't done much related to 3d audio recently. So i'm not sure if Unity provides some build-in way now. However you may want to have a look at this question over here
Some years ago i remember i've seen some asset that was able to simulate actual audio occlusion. So it basically ran some sort of pathfinding through the scene to determine how far away the source is and if there's actually a path.. Getting this to work reaslistically would require quite a bit of processing. You may want to think about what is really necessary. Game development is a lot about faking things so the user doesn't notice the difference. If you setup your scenes simple audio zones would probably be enough.
ps: this asset seems to have some sort of primitive sound occluder
Thank you for infor$$anonymous$$g me about those; I think that it might be just what I'm looking for.
The way I did this in one game was to do a raycast and check if any wall was blocking the direct path to the audio source.
If there was a blocking wall, then I'd adjust the audio settings (reduce volume etc.).
It is way simplified, but the results were good enough for me.
Follow this Question
Related Questions
3D Sound not working 0 Answers
Implementing binaural recording in an interactive manner -1 Answers
why i can hear my 3d sound anywhere 0 Answers
3D sound pan is flipped 4 Answers
3d sound priority. 0 Answers