Audio Source Volume not Fading Over Distance

Hello everyone, I’m encountering a problem where I can still here a sound being played at full volume even though I am well outside of the audio source’s maximum range (see in the pic my player is in the top left, and the sound source is in the bottom right). I have tried making the range of the audio source and changed its roll-off, nothing changes, the should it plays is audible at 100% volume no matter where the player is.

If anyone has an idea as to why this is happening, I would love to know.

Other Notes:

I only have 1 audio listen in the scene (attached to the camera on the player) → the error message in the console exists because for 1 frame when the level loads additive, there are 2 camera in the scene.

The audio clip is forced to mono (changing this option seems to make no difference)

Kind of a late reply but for whatevery reason this has to do with the “Spatial Blend” slider. Just set it to 1 and you will have it as you intended.

@TheRedGuy90
Not sure if you still have this problem, but I thought I’d post it anyways.
Try setting the maximum distance to 30 or something and the minimum distance to 1, this worked for me along with setting the spatial blend to 1.

You can use SpatialBlend (2D => 3D) this way, closer - mean more 2D, far - more 3D.

This gives you effect ‘2D AudioSource affect by min and max Distance’

using UnityEngine;

public class spatialFader : MonoBehaviour
{
  private Transform Listener;
  private AudioSource source;
 
  private float sqrMinDist;
  private float sqrMaxDist;
 
  void Start()
  {
    Listener = FindObjectOfType<AudioListener>();
    source = GetComponent<AudioSource>();
    if (!source) return;
 
    sqrMinDist = source.minDistance * source.minDistance;
    sqrMaxDist = source.maxDistance * source.maxDistance;
  }

  void Update()
  {
    if (!source || Listener) return;
    var t = (transform.position - Listener.position);
    t = (t*t  - sqrMinDist) / (sqrMaxDist - sqrMinDist);
    source.spatialBlend = Mathf.Lerp(10f,22000f,t);
  }
}

AudioSource.SpatialBlend = 1f;

Well this is not what you’d call an answer but I had too had also set the Spatial Blender to 1, the minimum distance to 1, and the maximum distance to 30 and I still have the Audio Fade problem so some1 please help me out as soon as possible I really need it.

@boddole, My Main Character starts with an Empty Object.

However, the Child Object is the ONLY thing that moves around, Camera with it.

The Audio Listener I had was on the MAIN EMPTY OBJECT. Which DOES NOT MOVE, only my Child Object and Camera move.

I removed the Audio Listener from the Main Object, and placed one on my Camera. That solved every problem.