- Home /
Question by
TheRichardGamer · Apr 25, 2013 at 02:59 PM ·
javascriptaudioaudiosourcemainmenubce0023
Error BCE0023 when using script for main menu
Hi, I'm trying to apply sounds when I either enter a 3d text with my mouse, or exit it. However, I get this error, /Assets/Scripts/TextControl.js(13,11): BCE0023: No appropriate version of 'UnityEngine.AudioSource.Play' for the argument list '(String)' was found. Here's my script:
var isQuitButton = false;
var LoadCamTime : float = 3;
var CamObj : GameObject;
var EnterS : AudioClip;
var Exit1 : AudioClip;
function OnMouseEnter ()
{
renderer.material.color = Color.red;
audio.Play("EnterS");
}
function OnMouseExit ()
{
renderer.material.color = Color.white;
audio.Play("Exit1");
}
function OnMouseUp ()
{
if(isQuitButton)
{
Application.Quit();
}
else
CamObj.animation.Play("LoadCamLev1");
yield WaitForSeconds(LoadCamTime);
Application.LoadLevel(1);
}
Comment
Answer by Graham-Dunnett · Apr 25, 2013 at 03:01 PM
There is no function AudioSource.Play()
that takes a string as an argument. See `AudioSource.clip` for the correct way to play an audio clip.