How to implement proximity sound in 2D

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By abbylian

I’d like the audio to be loud when the player is far from the source of the audio and it gets softer as they go near (the concept is based on a local belief). Is it possible with just AudioStreamPlayer and an attached script?