That user experience and ways of handling it greatly depend on the use case, and your custom code.
- For animations you usually pass
dt
toupdate
method to update the mixer. Passing a large time delta can result in things going crazy. requestAnimationFrame
is called only when your browser and tab are open. Switching tabs will temporarily disable therequestAnimationFrame
from being executed. Make sure you’re not handling any important, time-dependent logic there - usesetTimeout / setInterval
instead, as it’ll keep executing even when the tab is not in focus (it slows down when you minimise the browser, but it won’t stop. So if you update mixer insetTimeout / setInterval
loop, deltas will not get too big.)- Alternatively, you can just pause the entire logic and rendering when tab / browser is minised - visibilitychange event on document should help with that.