Skip to main content

AudioSource.PlayOneShot(AudioClip clip, number volumeScale = 0)

Plays an AudioClip, and scales the AudioSource volume by volumeScale.

Parameters:

NameTypeDescription
clipAudioClipThe clip being played.
volumeScalenumberThe scale of the volume (0-1).

Usage

---@type AudioSource
local audiosource;

---@type AudioClip
local clip;

---@type number
local volumeScale;


audiosource.PlayOneShot(clip, volumeScale)