Scene Transition Lag/Flashes

Godot Version

4.2.2

Question

Hi, I've been messing around in Godot trying to make a SceneManager, and I'm having problems with lag/weird image flashes on screen when I transition. I tried two different things and they gave related problems. In both I have a root node SceneManager and the other scenes are added as children.

Also for context, the two scenes I am using are a Main Menu and Multiplayer Room scene, both with no functionality just a bunch of UI that I slapped over a viewport that has a camera3d rotating in a world environment.

1st: I set it up so that I would just queue_free() the current scene and then SceneManager would be alerted and instantiate the new scene from a list of preloaded scenes. However when I did this and moved to the next scene for the first time, there was a very noticable flash of a godot splash screen or something before it showed the next scene. I tried to screen record but it’s not as visible there, but jolting in the actual game (also I can’t attach it, new member)
I assumed it must be lag due to loading the scene (even though I preloaded it) or something caused by me queue_freeing() before adding the next scene.

2nd: I looked into background loading with ResourceLoader because then I could confirm the scene was fully loaded before I queue_freed. I changed my scene manager to call ResourceLoader.load_threaded_request(next_scene_path) when the call to transition came in, then it would wait until the status was ResourceLoader.THREAD_LOAD_LOADED and finish the transition by adding an instance as child and then queue freeing the current (previous) scene. Then I tried it out and it just got worse… now it shows the same flash of godot splash screen (i think?) when changing from Menu → Room, and when I went from Room → Menu, there was a new flash which I can only describe as what looked like purple/red static. It only happens the first time I transition, the rest are fine, just with a tiny bit of lag.

I don’t think it’s a problem with the scene loading now, so what is causing the lag/images between scenes and how can I fix it?
Thanks and sorry for the long text.

I may be wrong, but this sounds like the typical stuff that goes on when instantiating new scenes. This is why Loading Screens are a thing, so that that kind of stuff is hidden and then the Loading Screen is closed once the whole scene has finally be instantiated.

Yes I did add a loading screen for the second one, it showed when the transition started and then hid afterwards, but this still happened. Maybe its just the timing is off? How exactly would I be sure that the scene has finished being added to hide it?