The Title explains it, basically when the player is inside a house or in my case a plane, the sound from the outside will get quieter and low frequencies will only pass through.

I have an idea for it but i can't code something like that as im just a beginner at coding.

My idea is:

The sound the object is coming from has a lazer like thing always aiming at the player while close enough to hear the sound, when the lazer aims at the player but theres a wall between then it will smoothly lower the volume a little depending on material type of the wall between the player

8 comments

1

Please make an attempt, or maybe ask for Dev Wiki resources.

0

Wdym by that?

0

You have to do it by yourself first, then come to this site if you have a problem

0

Try using ViewPort

0

There is no need for RayCasting. You can use a SoundEffect object to modify a Sound Object or Group. An easy muffler effect is a ReverbSoundEffect. Adjust the Mid/Low Gain to get a decent idea.

2

You can use a magnitude calculation to get a distance between two displacements if you wish to have proximity manipulation. Feed this distance to the Mid/Low Gains with a negative cast [ -(magnitude) ] to lower the Reverb respectively—resulting in a muffled sound. If you wish to do so, ensure unmodified Gain inherits from the magnitude of the Gain set, all the while HighGain remains 0.

0

RayCasting is appropriate in the scenario of determining material blockades.

0

If you're attempting to change the sound effect based on the walls around the character, I'd recommend using a RayCast from the character to the sound source to finding the part blocking the sound and then makes changes to the effects on the sound accordingly. But, as Feahren stated there isn't really a need for raycasting if you're just trying to cut out low end sounds when indoors, for example.