Hellu.
I've got a little questen regarding 3Dsounds. Well, the only thing 3Dsound actually does is to fix the pan of the sound so it's being played in the left or inte the right speakre, true? Well, I would also like the sound to fade out when the player are traveling FROM the sound, and vice versa. I've tried to fix this by using this code:
volume#=sqrt(object position X(1)+object position X(2)^2+(object position Z(1)+object position Z(2))^2)
If volume#>100 then volume#=100
If volume#<1 then volume#=0
Set sound volume 400,volume#
I've used the calculation found i this tutorial:
http://developer.thegamecreators.com/?f=t02/bm_tutorial_7
The problem that I'm facing is this:
Of course when I'm getting to far away from the object (2), Volume# equals zero (Volume#=0), but as I'm getting further and furhter away, it starts to increase again! The most logic thing would be if the value would become negative, wouldn't it?
So I'm wondering; is there an easy way to calculate the distance between two objects by using the X- and Z-coordinates of them?
Thanks!
www.godhatessweden.com
My name, Stora_tomtefar, means "big santa claus" in swedish.