I’m having a problem with a black screen appearing for a short duration while I switch scenes. The way I switch scenes is generally to launch the new level, then launch the hud, and then stop the current scene. It does make sense that the game hasn’t been able to preload and render the new scene before the old scene is stopped. So I tried to wait for an event on the new scene before stopping the old scene. I tried the ready event, postupdate and postrender event, but all of them seem to fire to early.
I made a simple example to show my problem. https://codepen.io/orjandh/pen/RwpBJZZ
Is the event firing to early or is there something I do not understand here? Or maybe there are other ways to prevent this black screen?