I’m creating a simple loading screen in UMG and I add it to viewport, then I run “Open Level” after a short delay, but it always destroys the widget as soon as the new level begins to load.
How can I make it persist until I destroy it?
I have tried creating it in the GameInstance and using Streaming Levels is not an option.
Correct and use the GetGameViewportClient()->AddViewportWidgetContent(MyWidget->TakeWidget()); to make sure it doesn’t get cleaned up when the player controller does.
It’s enough to create a variable in your GameInstance, even if you create the UI elsewhere, you can set that variable, so your UI will not be cleaned up during open level.