UGameInstance::CreateLocalPlayer

Adds a new player.

Windows
MacOS
Linux

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.

References

Module

Engine

Header

Runtime/Engine/Classes/Engine/GameInstance.h

Source

Runtime/Engine/Private/GameInstance.cpp

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback