I have this
var clip : AudioClip;
function Update () { if( Input.GetButtonDown("w") ) { audio.Play(AudioClip);
}
}
but unity says: no appropriate version of unityengine.audiosource,...
what do i need to do??
I have this
var clip : AudioClip;
function Update () { if( Input.GetButtonDown("w") ) { audio.Play(AudioClip);
}
}
but unity says: no appropriate version of unityengine.audiosource,...
what do i need to do??
Change to:
audio.PlayOneShot(clip);
You're using the type instead of the variable. Should be just "audio.Play()", and assign the clip using "audio.clip = clip".