#Game music keeps playing in the background

1 messages · Page 1 of 1 (latest)

shell eagle
#

Hey! I’m working on a web game with Naninovel and ran into something weird.

When I switch tabs or the browser loses focus, the game music keeps playing in the background instead of pausing. In my other Unity projects it usually pauses automatically.

Not sure where that could be coming from. Any idea where I should look?

shell eagle
#

I've managed to fix this issue by changing AudioController.cs and adding AudioListener.pause = true in a new OnApplicationPause() method, but this seems very odd that I need to do that. The default behavior in Unity seem to be to pause the music when focus is lost, but not when using Naninovel.

#

Alright, the culprit was:

cinder sand
# shell eagle Alright, the culprit was:

Note that that option not only affects music but the whole game. If you want your game to keep running but pause the music only, you may need to resort to tricks like the one you mentioned