RealDocs

AGameModeBase::GetSeamlessTravelActorList

function Engine Since 4.14
#include "GameFramework/GameModeBase.h"
Access: public Specifiers: virtual

Description

Called on the server during seamless travel to collect actors that should be moved into the next level. PlayerControllers and sub-authority actors are moved automatically regardless.

Caveats & Gotchas

  • This function is called **twice** per seamless travel — once going to the transition map (`bToTransition=true`) and once going to the destination map (`bToTransition=false`). Only add long-lived actors (e.g. a persistent GameState extension) on the second call, or you will carry unnecessary actors through the transition level.
  • Only dynamic actors in the PersistentLevel can be moved; actors that are part of a sublevel cannot be added to this list.
  • Adding an actor owned by another actor that is already in the list is redundant — such actors are transferred automatically as part of their owner.

Signature

virtual void GetSeamlessTravelActorList(bool bToTransition, TArray<AActor*>& ActorList)

Parameters

Name Type Description Default
bToTransition bool True when traveling from the old level to the transition map; false when traveling from the transition map to the new level.
ActorList TArray<AActor*>& Output array to populate with actors that should persist across the travel.

Return Type

void

Example

Persist a custom session manager actor across seamless travel C++
void AMyGameMode::GetSeamlessTravelActorList(bool bToTransition, TArray<AActor*>& ActorList)
{
    Super::GetSeamlessTravelActorList(bToTransition, ActorList);

    // Only carry the session manager into the final destination, not the transition map
    if (!bToTransition && SessionManagerActor)
    {
        ActorList.Add(SessionManagerActor);
    }
}

Version History

Introduced in: 4.14

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.