- Home /
Question by
mtasosm · Sep 16, 2014 at 08:32 PM ·
triggersounddestroy object
How can i make when a sound trigger activates another dissapears ?
i have sound trigger 1 and sound trigger 2 How can i make the trigger 2 dissapear after the player passes through the trigger 1 and the oposite (when the player passes trigger 2 the trigger 1 dissapears) ?
Comment
Did you want to disable the sound made by triggers or the triggers themselves?
Answer by jjplay175 · Sep 16, 2014 at 09:45 PM
you can use audio.Stop(); to stop sound or were you looking for something a little different?
bit of example script
audio.PlayOneShot(scene1sound, 1F); // Scene 1 sound
//Trigger2 starts here
audio.Stop(); // Stop Sound
audio.PlayOneShot(scene2sound, 1F); // Scene 2 sound
//Trigger1 starts here
audio.Stop(); // Stop Sound
audio.PlayOneShot(scene2sound, 1F); // Scene 1 sound
here is the API with a lot of handy things when it comes to sound
Edit: Added link to AudioSource