Hello!
I’m trying to figure out why audio is being heard outside of the max distance. As I play and get closer/further from the source, I see the vertical “Listener” line going closer and further away. When it’s out of the graph, I can still hear audio.
There is only one listener in the scene, and the stereo effect is active. My settings are below, and this is the code I’m using to start audio clips. Its entirely possible (likely maybe) that my code is the issue, as when I slider the volume down to 0 in the inspector, I can still hear the audio playing.
Any thoughts?
function PlayAudio(name : String){
var id : int = AudioClipID(name);
var volume : float = audioClips[id].volume;
var audioClip = audioClips[id].audioClips[Random.Range(0,audioClips[id].audioClips.Length)];
if (audioClips[id].volumeBySpeed)
volume = Mathf.Clamp(volume * Mathf.Abs(animator.GetFloat("locomotion")), audioClips[id].minVolume, audioClips[id].volume);
audioSource.PlayClipAtPoint(audioClip, transform.position);
}