Quantcast
Channel: Questions in topic: "plays"
Viewing all articles
Browse latest Browse all 6

Getting my 2D sound trigger to play only once

$
0
0
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

Viewing all articles
Browse latest Browse all 6

Latest Images

Trending Articles





Latest Images