Unknown identifier error

Hi Gang,

I’m trying to implement a simple audio script but I’m getting the following error:

TriggerAudio.js(6,21): BCE0005: Unknown identifier: ‘TreefrogsSound’.

I’m using a cube with a trigger to define the active area but the above error is coming up. TreefrogsSound is a sound file in my scene. Here is the script:

function OnTriggerEnter () {
audio.Play (TreefrogsSound);
}
function OnTriggerExit () {
audio.Stop (TreefrogsSound);
}

I’m a total Noob when it comes to scripting so even if its something blatantly obvious that I’ve missed please let me know. Any suggestions will help.

Thanks,

Josh

Hello,

I guess try

audio.PlayOneShot(TreefrogsSound)

assuming you declared the sound as a

var xxx : AudioClip;

just a guess

Ray

I didn’t declare the sound a variable. I wondered if that was it. I’ll give it a try tonight.

Best,

—Josh