Sound Occlusion
Summary
By default, sounds played in the world will be quieter if solid collision exists between the camera and the sound source.
Occlusion Settings
In each SoundEvent asset, a checkbox determines whether that particular sound is affected by occlusion.
In the Mixer window, an Occlusion slider determines how strongly all sounds played through the selected mixer are occluded.
Every s&box project has a built-in sound
tag. By default, this tag collides with the solid
tag, which is why solid colliders will muffle sound.
Suppose we had a tag named player
, and we wanted it to no longer occlude sound. We'd need only:
- Make sure that the
player
tag exists on the collision matrix. - Specify that
sound
vsplayer
collisions should be ignored, as shown below.
In any first-person game where your player has a collider, you should make sure that the collider does not occlude sound.
noblockaudio
would not occlude sound.
This is no longer the case. If your project was set up like this, then you will need to set sound
vs noblockaudio
collisions to "ignore" in the collision matrix to have the same functionality.