Before proceeding, please use the forum search feature at the top of the page to check if your question has already been answered.
How do I…
To trigger an ambiant sound in a specific area, and pitch it up and down depending on the position of the character from it?
I have a waterfall area and I want the water ambiant sound being eared depending on the distance of the player.
What is the expected result
The player can ear a waterfall ambiant sound pitching up as he’s approching,
and pitching down as he geeting away.
I think you can change how loud a sound is depending on how far or close the player is. I think this video might help. https://m.youtube.com/watch?v=RVtxL-XnexI
1 Like
MrMen
March 27, 2025, 11:15pm
3
This extension adjusts volume—maybe you can modify it to change pitch instead?
Just note that in reality pitch only changes with rapid movement between the sound source and observer (like a fast-moving car). A person running is not fast enough to cause a pitch shift.
1 Like
ZeroX4
March 28, 2025, 5:30am
4
Actually you just need expression for volume
100 - ( 100 / (CameraWidth()/2) * Player.DistanceToObject(Waterfall) )
Prevoously i wrote this
100 / (CameraWidth()/2) * Player.DistanceToObject(Waterfall)
And this is wrong
I mean its reverse
It will play sound louder as you move away
1st formula is correct
Because you want to play sound with volume 100 - how far in % player is from object
So 100 when player distance to object is 0% meaning he is in dead center
And if you move 5 % away from object then 100 - 5 = 95
2 Likes