Audio Distance


#1

I currently have a scene that has a plane flying around.
Is there a way to attach the audio to an object and have it get affected by distance - ie. when the plane is in the distance, its quiet, and vice versa when the plane is closer to the screen?


#2

Hi James,

You can grab the position of a node using the .position() function.

You can use the returned position values and add some code that will affect the volume of the audio using the .volume() function.

Hope this helps.

All the best,
Seb