- Home /
No appropriate version of 'UnityEngine.AudioSource.Play' for the argument list '(System.Type)' was found.
So I cant seem to get this simple script working. I have made a box collider that is trigger and added an audio source with the sound: DogeBark inside it. This is my script:
#pragma strict
var doge : AudioClip;
function OnTriggerEnter ()
{
audio.Play(DogeBark);
}
Comment
Answer by dmg0600 · Oct 02, 2014 at 11:06 AM
You don't have to specify the clip the will be played. Just call it audio.Play();
It will play whatever clip is in the AudioSource component. If you want to change that clip do it manually or assigning the variable audio.clip to your clip.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Animation spins wildly after completed 0 Answers
BCE0049 error with network script 0 Answers