Hi,
I am trying to play the sound Xylo_13 at the beginning of the game but it always returns with:
Assets/Music.js(9,1): BCE0004: Ambiguous reference ‘audio’: Music.audio, UnityEngine.Component.audio.
My code is here:
#pragma strict
@RequireComponent(AudioSource)
public var Xylo_13: AudioClip;
var audio: AudioSource;
function Start() {
audio = GetComponent.<AudioSource>();
audio.PlayOneShot(Xylo_13, 0.7F);
}
function Update () {
}
I don’t quite know what’s wrong. I’m following the template Here:
Please help as I can’t progress my game any further until I figure this out. Thanks.