UGameInstance::CreateLocalPlayer

Adds a new player.

Windows
MacOS
Linux

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/Engine/GameInstance.h

Include

#include "Engine/GameInstance.h"

Source

/Engine/Source/Runtime/Engine/Private/GameInstance.cpp

Syntax

ULocalPlayer * CreateLocalPlayer
(
    int32 ControllerId,
    FString & OutError,
    bool bSpawnPlayerController
)

Remarks

Adds a new player.

Returns

The player which was created.

Parameters

Parameter

Description

ControllerId

The controller ID the player should accept input from.

OutError

If no player is returned, OutError will contain a string describing the reason.

bSpawnPlayerController

True if a player controller should be spawned immediately for the new player.

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