Pausing Music and Resuming from Same Location?

Hi everyone!

I have a question regarding music integration. I’m hoping someone can help.

In this game I’m working on we have music that is triggered in the main level, but when a player enters a building that music stops until the player exits the building.

Upon exiting the building the music comes back on but always starts at the beginning of the piece.

Is it possible in F-MOD to set it up so that when exiting a building the music resumes from where it left off before the player entered the building?


It sounds like you might be calling Play on the sound to resume it after the pause.
Calling play on an event will start it from the beginning, you need to use setPaused(false) to resume a paused event.

Thank you Cameron. Is this something on the code side? So I need to set my event up in F-Mod Studio any differently? I just have an event set to looping, nothing fancy.

Just the code, you don’t need to change the event at all.

Use EventInstance.setPaused(true) to pause.
And EventInstance.setPaused(false) to resume.

Awesome thanks!