The code I put was
var sound: AudioClip;
function OnMouseUp(){
audio.PlayOneShot(sound);
}
it is not working. On the object I put the audio sound and an audio source. please help.
The code I put was
var sound: AudioClip;
function OnMouseUp(){
audio.PlayOneShot(sound);
}
it is not working. On the object I put the audio sound and an audio source. please help.
Try making it an AudioSource instead: (Make sure to attach it in both the script and inspector)
var sound : AudioSource;
function OnMouseUp() {
AudioSource.PlayOneShot(sound);
}