Navigation
API > API/Runtime > API/Runtime/Engine > API/Runtime/Engine/UGameInstance
Overloads
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
ULocalPlayer * CreateLocalPlayer
(
int32 ControllerId, |
Adds a new player. | Engine/GameInstance.h | |
ULocalPlayer * CreateLocalPlayer
(
FPlatformUserId UserId, |
Adds a new player. | Engine/GameInstance.h |
CreateLocalPlayer(int32, FString &, bool)
Description
Adds a new player.
| Name | CreateLocalPlayer |
| Type | function |
| Header File | /Engine/Source/Runtime/Engine/Classes/Engine/GameInstance.h |
| Include Path | #include "Engine/GameInstance.h" |
| Source | /Engine/Source/Runtime/Engine/Private/GameInstance.cpp |
ULocalPlayer * CreateLocalPlayer
(
int32 ControllerId,
FString & OutError,
bool bSpawnPlayerController
)
The player which was created.
Parameters
| Name | Remarks |
|---|---|
| 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. |
CreateLocalPlayer(FPlatformUserId, FString &, bool)
Description
Adds a new player.
| Name | CreateLocalPlayer |
| Type | function |
| Header File | /Engine/Source/Runtime/Engine/Classes/Engine/GameInstance.h |
| Include Path | #include "Engine/GameInstance.h" |
| Source | /Engine/Source/Runtime/Engine/Private/GameInstance.cpp |
ULocalPlayer * CreateLocalPlayer
(
FPlatformUserId UserId,
FString & OutError,
bool bSpawnPlayerController
)
The player which was created.
Parameters
| Name | Remarks |
|---|---|
| UserId | The platform user 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. |