AGameModeBase::ProcessServerTravel
#include "GameFramework/GameModeBase.h"
Access: public
Specifiers: virtual
Description
Initiates a server-side level transition that brings all connected clients to the new map. Calls CanServerTravel() first and triggers either a hard or seamless travel depending on the GameMode's bUseSeamlessTravel setting.
Caveats & Gotchas
- • Only call this on the server (HasAuthority()). Calling it on a client is a no-op at best and can cause assertion failures at worst.
- • If bUseSeamlessTravel is true, clients stay connected and actors listed in GetSeamlessTravelActorList() persist into the new level. With hard travel, all clients disconnect and reconnect — choose carefully, as hard travel resets all session state.
Signature
ENGINE_API virtual void ProcessServerTravel(const FString& URL, bool bAbsolute = false); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| URL | const FString& | The destination map URL, optionally including game options. | — |
| bAbsolute | bool | If true, the URL is treated as an absolute map path. Defaults to false. | false |
Return Type
void Example
Travel to a results screen after match end C++
void AMyGameMode::OnMatchEnd()
{
if (HasAuthority())
{
ProcessServerTravel(TEXT("/Game/Maps/ResultsScreen?listen"));
}
} See Also
Tags
Version History
Introduced in: 4.14
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?