I’m trying to fade out my music track (ambientSoundTrackTwo), which is spawned by an AudioControl script, as soon as a new scene is loaded. I’ve written the following code on my AudioControl.cs, but it doesn’t seem to be working:
Yes, I have added an AHDSR to the master track. The fade-out is working when I preview it on the FMOD Editor by holding the stop button, so I reckon there’s something wrong in my code.
Also, on Unity, if I preview the event on the Inspector window, as I press Stop, it doesn’t fade out. I’m not sure if that “stop” command is the same as the Non-Immediate Stop available on the Fmod Editor.
I guess maybe the problem is that the FMOD_Listener, which is attached as a component in the Camera Prefab, is being destroyed and spawned back again. Any ideas on how to avoid this?