- Home /
WebGL Run in Background only works 1 update per second
In my multiplayer game, I need 50 update calls in background. (If not 50, More than 1 would be better) Whenever the host minimizes or loses focus, it ends up as packet loss and massive lag (frozen gamestate) to the clients. How can I make WebGL game run in background properly?
Answer by Bunny83 · Nov 23, 2019 at 12:55 AM
This is not a limit of Unity but a limit that most browsers apply to open webpages. So they are only updated once per second. Keep in mind that your application is most likely not the only open tab (especially when your tab is in the background / not active).
So your Unity application as a whole will only be updated once per second. However as shown in this Photon example you can raise a custom event through plain javascript. However this will not increase the frame count.
ps: this question is essentially a duplicate of this one