Navigation
API > API/Runtime > API/Runtime/Engine
A context object that binds to a LocalPlayer. Useful for UI or other things that need to pass around player references
| Name | FLocalPlayerContext |
| Type | struct |
| Header File | /Engine/Source/Runtime/Engine/Classes/Engine/LocalPlayer.h |
| Include Path | #include "Engine/LocalPlayer.h" |
Syntax
struct FLocalPlayerContext
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FLocalPlayerContext
(
const ULocalPlayer* InLocalPlayer, |
Engine/LocalPlayer.h | ||
FLocalPlayerContext
(
const APlayerController* InPlayerController |
Engine/LocalPlayer.h | ||
| Engine/LocalPlayer.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| LocalPlayer | TWeakObjectPtr< class ULocalPlayer > | Engine/LocalPlayer.h | ||
| World | TWeakObjectPtr< UWorld > | Engine/LocalPlayer.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UGameInstance * GetGameInstance() |
Returns the game instance | Engine/LocalPlayer.h | |
T * GetGameState
(
bool bCastChecked |
Templated Getter for the Game State | Engine/LocalPlayer.h | |
| Getter for the Game State Base | Engine/LocalPlayer.h | ||
T * GetHUD
(
bool bCastChecked |
Templated Getter for the HUD | Engine/LocalPlayer.h | |
| Getter for this player's HUD | Engine/LocalPlayer.h | ||
ULocalPlayer * GetLocalPlayer() |
Returns the local player. | Engine/LocalPlayer.h | |
T * GetPawn
(
bool bCastChecked |
Templated getter for the player's pawn | Engine/LocalPlayer.h | |
| Getter for the base pawn of this player | Engine/LocalPlayer.h | ||
T * GetPlayerController
(
bool bCastChecked |
Templated version of GetPlayerController() | Engine/LocalPlayer.h | |
| Returns the player controller. | Engine/LocalPlayer.h | ||
T * GetPlayerState
(
bool bCastChecked |
Templated Getter for the Player State | Engine/LocalPlayer.h | |
| Getter for the Player State | Engine/LocalPlayer.h | ||
UWorld * GetWorld() |
Returns the world context. | Engine/LocalPlayer.h | |
bool IsFromLocalPlayer
(
const AActor* ActorToTest |
This function tests if the given Actor is connected to the Local Player in any way. | Engine/LocalPlayer.h | |
bool IsInitialized() |
Is this context initialized | Engine/LocalPlayer.h | |
bool IsValid() |
Is this context initialized and still valid? | Engine/LocalPlayer.h |