Hey guys! I’ve had some issues with my async loading screen for my multiplayer game. It works great when I test it in the main menu and lobby but once I introduce server travel / seamless travel it seems to act differently.
With this setup I get it to appear for a brief second (Where I expect 5 sec here) and then the screen just goes black and the throbber disappears. When I then click on the screen it goes to the next level instantly. I’m aware that this approach wants me to manually stop the loading screen at the moment but one step at a time
Game Instance:
void UBaseGameInstance::Init()
{
Super::Init();
FWorldDelegates::OnSeamlessTravelStart.AddUObject(this, &UBaseGameInstance::OnSeamlessTravelStart);
}
void UBaseGameInstance::OnSeamlessTravelStart(UWorld* PersistentWorld, const FString& LevelName)
{
StartInGameLoadingScreen(true, 5);
}
void UBaseGameInstance::StartInGameLoadingScreen(bool bPlayUntilStopped, float PlayTime)
{
FLoadingScreenAttributes LoadingScreen;
LoadingScreen.bAutoCompleteWhenLoadingCompletes = !bPlayUntilStopped;
LoadingScreen.bWaitForManualStop = bPlayUntilStopped;
LoadingScreen.bAllowEngineTick = true;
LoadingScreen.MinimumLoadingScreenDisplayTime = PlayTime;
LoadingScreen.WidgetLoadingScreen = FLoadingScreenAttributes::NewTestLoadingScreenWidget();
GetMoviePlayer()->SetupLoadingScreen(LoadingScreen);
GetMoviePlayer()->PlayMovie();
}
Game Mode:
void AGM_LobbyHost::BeginPlay()
{
Super::BeginPlay();
bUseSeamlessTravel = true;
}
void AGM_LobbyHost::StartTheMatch()
{
ProcessServerTravel(MapName);
}