Yesterday I decided to try the Fmod Unity Timeline Integration. I re-exported the banks and created a new Fmod Event Track and linked it to a newly created event.
Right after that, when I run the game in the Editor, I’ve been getting an Exception from the RuntimeManager.cs the moment I unload the current scene and load a new one(it does NOT happen if I reload the current scene or when I first load the initial scenes):
Exception: [FMOD] Attempted access by script to RuntimeManager while application is quitting
FMODUnity.RuntimeManager.get_Instance () (at Assets/Plugins/FMOD/RuntimeManager.cs:52)
FMODUnity.RuntimeManager.SetListenerLocation (Int32 listenerIndex, UnityEngine.GameObject gameObject, UnityEngine.Rigidbody2D rigidBody2D) (at Assets/Plugins/FMOD/RuntimeManager.cs:957)
FMODUnity.StudioListener.SetListenerLocation () (at Assets/Plugins/FMOD/StudioListener.cs:42)
FMODUnity.StudioListener.Update () (at Assets/Plugins/FMOD/StudioListener.cs:31)
After a full day of pulling my hair out, I’m starting to wonder if maybe I did some obscure change that created this issue…
The error log doesn’t point to any specific code, so I’m assuming it’s due to some entities being unloaded (btw, is there a way to have a more detailed error log?).
When I click on the actual error in Unity it highlights my AudioListener GameObject (that is instanced in a Scene that doesn’t get destroyed on load) and contains the StudioListener.cs.
Also going through the code just before the error, I can see that the function that triggers it is from the StudioListener.cs when doing:
void Update()
{
SetListenerLocation();
}
And I can see that the error in the RuntimeManager.cs is because the isQuitting flag is being set to true right after the SetListenerLocation is called:
void OnDestroy()
{
if (studioSystem.isValid())
{
studioSystem.release();
studioSystem.clearHandle();
}
initException = null;
instance = null;
isQuitting = true;
}
Is the problem because the RuntimeManager no longer exists and was destroyed? Is that the expected behavior on level load? (Is there only one instance of the RuntimeManager per game?)
Is it the StudioListener that should not be calling the RuntimeManager during level load and it should be disabled?
Is it some entity that didn’t get destroyed properly? How can I track it?
Any help would be VERY appreciated.
Thanks.