- Home /
This question was
closed Nov 28, 2014 at 08:35 PM by
Graham-Dunnett for the following reason:
Duplicate Question
Question by
RicardoAntezana · Nov 28, 2014 at 08:35 PM ·
audiodestroyaudioclipaudio.playbce0023
AudioClip won't play??
When I enter a box collider I want a game object to perform an animation, play a sound and then dissapear, but when I try it doesn't work. Here's my script:
#pragma strict
private var WillJumpscare : boolean = false;
var Jumpscare : AnimationClip;
var JumpscareSound : AudioClip;
function OnTriggerEnter (other : Collider)
{
WillJumpscare = true;
}
function OnTriggerExit (other : Collider)
{
WillJumpscare = false;
}
function Update () {
if(WillJumpscare == true)
{
animation.Play("Jumpscare");
audio.Play("JumpscareSound");
yield WaitForSeconds (audio.clip.length);
Destroy (gameObject);
}
}
Here is the error:
Assets/Scripts/Jumpscare.js(22,35): BCE0023: No appropriate version of 'UnityEngine.AudioSource.Play' for the argument list '(String)' was found.
Please help.
Comment