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

var rolloffMode : AudioRolloffMode

Description

Sets/Gets how the AudioSource attenuates over distance

JavaScript

function Start() {
audio.rolloffMode = AudioRolloffMode.Linear;
}

using UnityEngine;
using System.Collections;

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

import UnityEngine
import System.Collections

class example(MonoBehaviour):

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