- Home /
Question by
awesomeman · Mar 30, 2013 at 11:20 PM ·
audioonmouseup
Audio when using OnMouseUp
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.
Comment
Best Answer
Answer by LightSource · Mar 31, 2013 at 12:33 AM
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);
}
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Help with walking script 0 Answers
Audio Destroy Help! 1 Answer
Footstep Script Not Working 2 Answers
Need help making an audio trigger. 2 Answers