engine.displayLoadingUI() and engine.hideLoadingUI() used in quick successions

I found that the loading screen (at least the preset one) is working poorly when I tried to toggle it on and off in quick succession (basically having engine.displayLoadingUI() and engine.hideLoadingUI() called quickly next to each other when applicable)

Here’s a PG example you can try and see what I mean: Babylon.js Playground

Is this a known issue?

This is expected. JavaScript has only one thread so calling show, hide, show in a row will break the DOM system has it has to wait for the assets to be ready and animation to be completed.

This is mostly because of the transitionEnd event:

1 Like

Is there a way to tell when the animation ends and the loading screen becomes ‘ready’ to be hidden/shown?

We could think about adding an observable for that maybe?

1 Like