I dont see any script for unity 5 about trigger sound, I only found scripts for unity 4 and this dont work. So I need your help. (Sorry for my bad english I am from spain).
EDIT:
var Sound : AudioClip;
function OnTriggerEnter(){
audio.PlayOneShot(Sound);
}
This is the script that I use, AND I HAVE GOT THIS ERROR:
Assets/DI�LOGOS/SONIDOPERSONAJES.js(4,2): BCE0144: ‘UnityEngine.Component.audio’ is obsolete. Property audio has been deprecated. Use GetComponent() instead. (UnityUpgradable)
I want also that this sound will be delete when the sound finish.
Thaks.