S&box Wiki

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.

image.png

In the Mixer window, an Occlusion slider determines how strongly all sounds played through the selected mixer are occluded.

image.png

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.

image.png

Suppose we had a tag named player, and we wanted it to no longer occlude sound. We'd need only:

  1. Make sure that the player tag exists on the collision matrix.
  2. Specify that sound vs player collisions should be ignored, as shown below.
image.png

In any first-person game where your player has a collider, you should make sure that the collider does not occlude sound.

Previously, any collider tagged 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.