how can i stop sound from going through my walls?

hello, i just started with creating my own levels in unity but when i add sound it keeps going through my walls and i don’t want that, how can i prevent this?

1 Answer

1

A simple solution would be to define “Zones” in your level.

When the player enters a zone, enable the sound that he should be able to hear, and disable the rest.

This can be done with a combination of Trigger Colliders and a simple script referencing all the related audio objects.

E.g.

Define 4 Zones: A,B,C and D. Player enters Zone A, enable the sounds in Zone A, disable the sounds in Zone B,C and D. When the player leaves Zone A and enters Zone B, enable the sounds in Zone B, and disable the rest.