UGameplayStatics::CreatePlayer

Create a new player for this game.

Windows
MacOS
Linux

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/Kismet/GameplayStatics.h

Include

#include "Kismet/GameplayStatics.h"

Source

/Engine/Source/Runtime/Engine/Private/GameplayStatics.cpp

Syntax

static APlayerController * CreatePlayer
(
    const UObject * WorldContextObject,
    int32 ControllerId,
    bool bSpawnPlayerController
)

Remarks

Create a new player for this game.

Returns

The created player controller if one is created.

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 player controller should be spawned immediately for this player. If false a player controller will not be created automatically until transition to the next map.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss