Hi there,
Working on a simple 2D platformer game and I would like a narrator to be triggered when the character moves through a box collider. My problem is that if you move back into that the trigger the sound clip plays again. Ideally the sound clip would be removed after it has completely played through after being triggered once.
#pragma strict
function OnTriggerEnter2D(Collider2D) {
audio.Play();
}
This is attached to a box collider that has an Audio Source. I don't have any programming knowledge so any help would be very much appreciated.
Cheers,
Jack
↧