UGameplayStatics::CreatePlayer

Syntax

UFUNCTION (BlueprintCallable , Category="Game" ,
          Meta=(WorldContext="WorldContextObject", AdvancedDisplay="2", UnsafeDuringActorConstruction="true"))
static APlayerController * CreatePlayer
(
    UObject * WorldContextObject,
    int32 ControllerId,
    bool bSpawnPawn
)

Remarks

Create a new player for this game.

Parameters

Parameter

Description

ControllerId

The ID of the controller that the should control the newly created player. A value of -1 specifies to use the next available ID

bSpawnPawn

Whether a pawn should be spawned immediately. If false a pawn will not be created until transition to the next map.

References

Module

Engine

Header

Runtime/Engine/Classes/Kismet/GameplayStatics.h

Source

Runtime/Engine/Private/GameplayStatics.cpp