Right. I've got a bit of a problem in GM 8 and would be eternally grateful if someone could help me out with it.
So I've got a bit of code that plays a sound from a certain object, and adjusts the volume based on distance to the player (louder if close, softer if far).
if distance_to_object(oAlinaPlayer)>500//the max distance to be able to hear it
{
sound_volume(xBubbleEnergy,0)
}
else
{
Vol=.8
Vol-=distance_to_object(oAlinaPlayer)/1000//increase this if you want the volume to decrease/increase slower
sound_volume(xBubbleEnergy,Vol)
}
This is the problem:
I think it is caused by the volume setting for one object is overriding the volume setting for all the others. Do you guys know how I can deal with this properly?
Thanks,
John Sandoval