Game pauses when user changes browser tab (even with RunInBackground)

Hi!,

I’m developing a simple webgl game, where the user has to click some buttons in a given time in order to get to the next level, but I’ve found a problem with the game pausing if it loses focus.

Setting the “RunInBackground” option in the player settings fixed one problem, now the game doesn’t pauses when the browser loses focus, but it still freezes if the user switch the active tab on the browser.

Am I missing something? Is there a workaround to fix it?

We’ve added some more info about this in a future version of the manual:

If the Run in background is enabled in the WebGL Player Settings, or if you enable Application.runInBackground, then your content will continue to run when the canvas or the browser window loses focus.

However, it should be noted that browsers may throttle content running in background tabs. If the tab with your content is not visible, your content will only be updated once a second in most browsers. Note that this will cause Time.time to progress slower than usual with the default settings, as the default value of Time.maximumDeltaTime is lower than one second.