i want to add an audio jumpscare to my game, I know I have to add something in the if statement but don’t know what.heres what i’ve come up with so far: please read under script too
#pragma strict
var soundClip:AudioClip;
function OnTriggerEnter(o:Collider)
{
Debug.Log("The trigger played");
audio.PlayOneShot(soundClip);
}
function OnTriggerExit(o:Collider)
{
Debug.Log("trigger deleted");
if (something like if trigger exit)
Destroy(GameObject);
}
I need it to play for 3 seconds and to be destroyed on trigger exit