How to make sound "wrap" through walls

I want to make sound wrap through walls, so basically you cannot hear sounds through walls for realism purposes.

Is there any way to do this?

1 Like

Roblox is actively updating their new Audio API! I would definitely recommend checking out their posts regarding the Audio API, it’ll definitely be relevant for you. :smiley:

1 Like

If you have the position of where the sound is played, you can make your own sound wrapper.

So basically, cast a ray from your character to the sound and check if there is an object in the way, that probably is a wall and the make the volume of the sound 0

there are many ways to do that,

but mine is to:

  1. make a part hitbox, so that whenever it touches, it activates a boolean
  2. make a local script followed with a module script inside it that calculates the distance between the player and the parts emitting the sounds (STARTERPLAYER)
  3. calculate.