- Home /
Atmosphere sounds triggered by invisible blocks? (JS)
In this scene, the player starts in a house, and when he walks out and into the forest I would like to have the music playing to fade out and be replaced by a fading in wind noise. I have an empty "manager" asset that just plays the music and I have a huge "transparencyFX" cube that is a trigger for a script that doesn't work. The script is meant to find the music in one gameObject and replace is with the script's own music (fading).
So, what I'm pretty much asking is how do I fade from one sound to another and have the first sound collected from another gameObject. I'd like to reuse this for multiple invisi-blocks, like a daisy-chain of fading music for various moods and such. (I can upload the terrible script if you want, but it's so bad I don't think much will come from it)
Thank you very much in advance.
Posting some code might help. Also you may be interested in my upco$$anonymous$$g Audio Brush product should ship mid-September http://qlcomp.com/?page_id=61 which will make this even easier.
Answer by lancer · Aug 27, 2013 at 06:48 PM
Use an empty with a box collider and use:
function OnTriggerEnter(){
}
And:
function OnTriggerExit(){
}