Okay, I’m trying to set up ambient city noise outside the building in my scene. However, when I make the audio source, it plays the sound (quite loudly, too) even outside the maximum distance I specified. I’ve tried everything I can think of- messing with the size of the min and max distances, trying both linear and logarithmic rolloff, nothing works.

I’m having the same problem with other sounds in my scene, and it’s getting really frustrating. Does anyone have a solution for this?

I’ve been having this same problem and it seems the Unity 5 solution is to set the Audio Source’s Spatial Blend setting to 1. The slider is in the same section as Priority and Volume. When set to 0, the distance settings are ignored.

I was having the same problem! I switched the volume rolloff from Logarithmic to custom, and then it worked! Not sure why logarithmic didn’t work though.

@ashapi3 When you first create an audio source the default max distance is 500 and the curve is set to meet zero on the Y axis at 500.

If you edit the max distance in the input field the curve is still the same and doesn’t conform to your newly edited max distance.

So you have to edit it so that the last node on your curve is hitting zero otherwise the actual max distance is still 500. You might have to set it back to 500 so that you can delete unnecessary nodes so you don’t get weird bumps in your curve out at far distances before setting it to the desired max distance.

And if you need to eliminate panning but also have the effect of roll of at max distance, you can leave the pan at 1 but set the spread to 180 which will remove left-right panning.

I have the exact same problem… HELP!!!

This is due to PatialBlend is set to 2D by default.

You need to do following setting :

GameObject ==> Audio Source ==> Spatial Blend (Drag it from 2D to 3D).

That’s it .

Enjoy…

Like the other said You Have to activate 3d sound with slider on Spatial Blend, But the important thing is the “audio listener”… must be on the object is getting near or far from 3d sound.

When Spatialize is set to true it won’t fade out the AudioSource completely.

You can set the volume rolloff to linear in this case, instead of logarithmic, but at this stage you have to wonder why audio is completely bugged in Unity.

I had the same issue with 5.3…The end of the Audio line must hit the horizontal 0 axis. If it does not, then it will continue to play outside of the radius terminus.

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);
  }
}

Click the sound file and uncheck “3D Sound”