I’m not a good blueprint user so may be wrong, but I think you can’t do that you want with blueprints.
By default only PlayerController, PlayerState, PlayerCameraManager and HUD actors will be seamless traveled to new level (that’s not entirely true, but more on that below), other actors from that documentation is persist only for the transitions map and will be destroyed with it.
That’s what really happened.
GameMode and PlayerContoller has function GetSeamlessTravelActorList.
void AGameModeBase::GetSeamlessTravelActorList(bool bToTransition, TArray<AActor*>& ActorList)
{
// Get allocations for the elements we're going to add handled in one go
const int32 ActorsToAddCount = GameState->PlayerArray.Num() + (bToTransition ? 3 : 0);
ActorList.Reserve(ActorsToAddCount);
// Always keep PlayerStates, so that after we restart we can keep players on the same team, etc
ActorList.Append(GameState->PlayerArray);
if (bToTransition)
{
// Keep ourselves until we transition to the final destination
ActorList.Add(this);
// Keep general game state until we transition to the final destination
ActorList.Add(GameState);
// Keep the game session state until we transition to the final destination
ActorList.Add(GameSession);
// If adding in this section best to increase the literal above for the ActorsToAddCount
}
}
and
void APlayerController::GetSeamlessTravelActorList(bool bToEntry, TArray<AActor*>& ActorList)
{
if (MyHUD != NULL)
{
ActorList.Add(MyHUD);
}
// Should player camera persist or just be recreated? (clients have to recreate on host)
ActorList.Add(PlayerCameraManager);
}
These functions calls for GameMode and each PlayerController and outs array of actors that has to be persist. It’s called twice for OldMap->TransitionMap and for TransitionMap->NewMap travels. bToTransition parameter means is it OldMap->TransitionMap(true) or TransitionMap->NewMap(false) travel. So if you want to make an actor persistent you have to override one of these functions and add that actor to out ActorList.
Now about some issues.
Above I said that PlayerController and PlayerState will be traveled to the new map.
For PlayerController it’s true only if the new map has the same player controller class in it’s GameMode settings. In case when it’s not will be created a new PlayerController instance and data from old controller will be transfer with SeamlessTravelFrom and SeamlessTravelTo functions inside PlayerController:
void APlayerController::SeamlessTravelTo(APlayerController* NewPC)
{
CleanUpAudioComponents();
}
and
void APlayerController::SeamlessTravelFrom(APlayerController* OldPC)
{
// copy PlayerState data
if (OldPC->PlayerState)
{
OldPC->PlayerState->Reset();
OldPC->PlayerState->SeamlessTravelTo(PlayerState);
OldPC->PlayerState->Destroy();
OldPC->PlayerState = NULL;
}
// Copy seamless travel state
SeamlessTravelCount = OldPC->SeamlessTravelCount;
LastCompletedSeamlessTravelCount = OldPC->LastCompletedSeamlessTravelCount;
}
For PlayerState will always be created a new instance and data from old one will be transfer with SeamlessTravelTo function inside PlayerState:
void APlayerState::SeamlessTravelTo(APlayerState* NewPlayerState)
{
DispatchCopyProperties(NewPlayerState);
NewPlayerState->SetIsOnlyASpectator(IsOnlyASpectator());
}
and this function will eventually call CopyProperties:
void APlayerState::CopyProperties(APlayerState* PlayerState)
{
PlayerState->SetScore(GetScore());
PlayerState->SetCompressedPing(GetCompressedPing());
PlayerState->ExactPing = ExactPing;
PlayerState->SetPlayerId(GetPlayerId());
PlayerState->SetUniqueId(GetUniqueId());
PlayerState->SetPlayerNameInternal(GetPlayerName());
PlayerState->SetStartTime(GetStartTime());
PlayerState->SavedNetworkAddress = SavedNetworkAddress;
}
So to seamless travel some data you can override this functions.
And do not try to make persist a GameMode. It doesn’t work, and even if will that’s anyway bad because each map has own GameMode class, and doing that way may provide some unexpected bugs and inconveniences. If I need to have some global data I’d like to use GameInstanceSubsystem.