AGameModeBase::FindPlayerStart
#include "GameFramework/GameModeBase.h"
Access: public
Specifiers: virtualUFUNCTIONBlueprintNativeEvent
Description
Returns the PlayerStart actor to use for a player's next spawn. Checks the player's saved StartSpot first, then uses IncomingName to find a tagged start, and finally falls back to ChoosePlayerStart.
Caveats & Gotchas
- • If IncomingName matches a PlayerStart's PlayerStartTag, that specific start is used regardless of whether it is occupied — check occupation in your override if needed.
- • The C++ virtual version is the canonical override point. K2_FindPlayerStart is a separate Blueprint-accessible wrapper that calls this method; do not override both.
- • If the controller has a previously saved StartSpot and ShouldSpawnAtStartSpot returns true, neither IncomingName nor ChoosePlayerStart will be consulted.
Signature
ENGINE_API AActor* FindPlayerStart(AController* Player, const FString& IncomingName = TEXT("")); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| Player | AController* | The controller for the player who needs a spawn location. | — |
| IncomingName | const FString& | Optional tag name of a specific PlayerStart actor to use. | TEXT("") |
Return Type
AActor* Example
Find a named start from URL option C++
// During PostLogin, read the URL option and route the player to a named start
void AMyGameMode::PostLogin(APlayerController* NewPlayer)
{
Super::PostLogin(NewPlayer);
FString StartName = UGameplayStatics::ParseOption(OptionsString, TEXT("start"));
if (!StartName.IsEmpty())
{
AActor* Start = FindPlayerStart(NewPlayer, StartName);
if (Start)
{
RestartPlayerAtPlayerStart(NewPlayer, Start);
}
}
} See Also
Version History
Introduced in: 4.14
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?