Loading screen and controller instantiation


I have just created a loading screen by creating a widget in the persistent level, and loading the sub level on Begin Play. My controller however creates a widget as soon as it is spawned, so the HUD shows up before loading is complete. I can fix this by simply adding another event to my controller that creates the widget, and call this after the sub level has been loaded. I was wondering however if there was a more idiomatic way to do this, by for instance deferring instantiation of the controller and the pawn until after loading the sub level has completed.


You could always just change the Z Order of the Loading Screen widget so it sits on top of the Hud widget. This way, although your hud widget will load during the loading screen, it won’t be on screen until you remove the loading screen widget.


Thanks for the fast response! I’d rather not mess around with the Z-order though. It might lead to unintuitive behavior if someone assumes the widget is not going to be added to the viewport until the game actually begins. I will simply add a function to my player controller that is called when loading is complete.