AudioSource.rolloffMode Manual     Reference     Scripting  
Scripting > Runtime Classes > AudioSource
AudioSource.rolloffMode

var rolloffMode : AudioRolloffMode

Description

Sets/Gets how the AudioSource attenuates over distance

JavaScripts
audio.rolloffMode = AudioRolloffMode.Linear;

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
void Awake() {
audio.rolloffMode = AudioRolloffMode.Linear;
}
}

import UnityEngine
import System.Collections

class example(MonoBehaviour):

def Awake():
audio.rolloffMode = AudioRolloffMode.Linear