Seamless, Proper Loading Screens! [Play Movies, Audio & Animated Widgets!]

For everybody trying to get seamless travel to work with loading screen, it IS possible, I’ve figured it out, without too much additional modifications to TheJamsh’s code.

you’ll first need to make the functions callable from blueprint:


UCLASS()
class MYPROJECT_API UMyGameInstance : public UGameInstance
{
    GENERATED_BODY()

    public:
    virtual void Init() override;

    UFUNCTION(BlueprintCallable, Category = "Loading")
        virtual void BeginLoadingScreen(const FString& MapName);
    UFUNCTION(BlueprintCallable, Category = "Loading")
        virtual void EndLoadingScreen(UWorld* InLoadedWorld);

};


Then, use these exact settings if you want your loading screen to work automatically for both seamless and non-seamless travel. The key component is LoadingScreen.bAllowEngineTick = true; This allows the game thread to continue running while playing a movie, imitating the behavior of a non-seamless loadscreen call.


void UMyGameInstance::BeginLoadingScreen(const FString& InMapName)
{
    if (!IsRunningDedicatedServer())
    {
        FLoadingScreenAttributes LoadingScreen;
        LoadingScreen.WidgetLoadingScreen = FLoadingScreenAttributes::NewTestLoadingScreenWidget();

        LoadingScreen.bAutoCompleteWhenLoadingCompletes = true;
        LoadingScreen.MinimumLoadingScreenDisplayTime = 6000;
        LoadingScreen.bMoviesAreSkippable = false;
        LoadingScreen.bWaitForManualStop = false;
        LoadingScreen.bAllowEngineTick = true;

        GetMoviePlayer()->SetupLoadingScreen(LoadingScreen);
        GetMoviePlayer()->PlayMovie();
    }
}

void UMyGameInstance::EndLoadingScreen(UWorld* InLoadedWorld)
{
    GetMoviePlayer()->StopMovie();
}

Then inside blueprints (I’m using my Lobby’s pawn, that works for me), call your functions as such:

side note: I dont think Begin Loading Screen “Map Name” variable needs a value since it’s not used.

This will show the loading screen on all clients and listen server until your final map has finished loading. :slight_smile: