I’m working on a game In Unity where we use FMOD. We trigger sound from Unity in 2 ways: through the FMOD event emitter, and by calling RuntimeManager.PlayOneShot on the event path.
We have a problem where when we reload the scene containing our player object, which also houses the calling code for a bunch of player related sound (walking, jumping, etc) the one-shots stop being audible. Event-emitter-based sounds work fine still.
Debugging shows that the code is still succesfully calling it, finding a corresponding GUID and then creating an instance. Even the FMOD profiler is registering the events:
Any idea what could cause this?
Are the oneshot events being attached to a game object? It might be that upon reloading a scene, the gameobject it was previously attached to is somewhere else in the game world and is too far for the listener to pick up.
@richard_simms they are fired from a gam object! The player one-shot events are fired from the player object, which is also where the StudioListener is rooted, as it’s a first person game. I double checked that there are no references to old objects, both the listener and the emitters are located on the new player.
Thank you for confirming that. Could you please check the Unity console and attach a Live Update session to the Unity game and see if any issues are reported in the Window > Console > Logging dialog in FMOD Studio?
Hi, a bit of a late reply. I’m the sound designer for the game. I don’t quite understand what you mean exactly? I tried opening the console in FMOD, while running Live Update, and running the profiler, but that doesn’t seem to give much of anything. Not sure I’m using it correctly.
You have it right - attach FMOD Studio to Unity via Live Update, open both Unity and FMOD Studio’s console and reproduce the error. If this isn’t producing any errors then we may need to get a hold of the Unity project itself to check on our machines. Are you able to send this Unity project to me via DM?
Our current codebase requires permission from externals in order to be shared, so we need to ask them first. We’re gonna try and create a new unity project with the same save/load system and see if we can reproduce the effect, if we still get it there, we will send that project to you.
Sorry for a very late reply to this, I sent you a DM as well, but got in contact with @joseph who mentioned it was better to just bump the thread.
We got busy on different work packages and just lived with the bug until now, hoping it would resolve itself by updating FMOD and Unity to the latest versions. This however, has not been the case, so now we’re back to wanting to share the project. We don’t need permission from externals to share our codebase anymore, so we actually wanted to ask if we can just give you access to the repository altogether?
Sorry I missed that DM Felix. Sure, you can send us over the repository and we’ll take a look into this issue for you. Please be sure to DM myself or send an email to firstname.lastname@example.org with the details on sharing this repository so that it’s not public.
No worries Richard, thanks for the response. I’ve sent you a DM.
For anyone finding this Q&A, the issue was a snapshot (“Pause”) instance not releasing correctly in game code when going from the pause menu back to the title screen. This snapshot instance muted certain events routed into a few buses which caused them to be inaudible upon restarting the game.