i have this code and i get the error above
#pragma strict
function Start () {
var impacter : AudioClip;
}
function OnMouseDown(){
AudioSource.Play(
Debug.Log("audio is working");
}de here`
i have this code and i get the error above
#pragma strict
function Start () {
var impacter : AudioClip;
}
function OnMouseDown(){
AudioSource.Play(
Debug.Log("audio is working");
}de here`
Well, there’s a few things wrong.
Instead it should be;
#pragma strict
var audioSource : AudioSource; //Set this in the inspector
function Start ()
{
var impacter : AudioClip; //What is this meant to be doing?
}
function OnMouseDown ()
{
audioSource.Play (); //Play that specific audio source
Debug.Log ("Audio is working.");
}