Skip to content

format

typescript
AudioSource.rolloffCurve

class: AudioSource

description

The volume attenuation curve of the audio source.

When the rolloffMode is set to Custom, this specifies the volume attenuation curve. Setting this value will override the settings of minDistance and maxDistance. Each Vector2 in the curve represents a distance and a volume level (between 0 and 1).

parameter

param_nametypedescription

reture

typedescription
Vector2[]The volume attenuation curve.

code example

typescript
let obj = new GameObject();
let source = obj.AddComponent<AudioSource>(AudioSource);
source.rolloffCurve;