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

function PlayOneShot (clip : AudioClip, volumeScale : float = 1.0F) : void

Description

Plays an AudioClip.

// Play impact audio clip when colliding with something
var impact : AudioClip;
function OnCollisionEnter () {
audio.PlayOneShot(impact);
}