Script Error: BCE0023: No appropriate version of 'UnityEngine.AudioSource.Play' for the argument list '(System.Type)' was found.

No appropriate version of ‘UnityEngine.AudioSource.Play’ for the argument list ‘(System.Type)’ was found.

When I was working with Unity 3.4.2 and below, I didn’t have this problem. But now, after using Unity 3.5 Public Beta, the following script refuses to work due to the error above:

var blipSound = AudioClip;

function playSound(){
     Debug.Log("Audio Playing.");
     audio.Play(blipSound);
}

What’s up with that?! Can anybody help?

var blipSound : AudioClip;

function playSound(){
    audio.clip = blipSound;
    audio.Play();

}

I have not compiled this code. Essentially at 3.5 you need to tell Unity what type each variable has, and the Play() function doesn’t take a clip as an argument.

Never mind…
I erased the (blipSound) and added an Audio Source with the clip I wanted to play in that. Then, I ran the script and it worked. Sorry for the trouble, people!!

:wink: