FLocalPlayerContext

A context object that binds to a LocalPlayer.

Windows
MacOS
Linux

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/Engine/LocalPlayer.h

Include

#include "Engine/LocalPlayer.h"

Syntax

struct FLocalPlayerContext

Remarks

A context object that binds to a LocalPlayer. Useful for UI or other things that need to pass around player references

Constructors

Name Description

Public function

FLocalPlayerContext()

Public function

FLocalPlayerContext

(
    const APlayerController* InPla...
)

Public function

FLocalPlayerContext

(
    const FLocalPlayerContext& InPlaye...
)

Public function

FLocalPlayerContext

(
    const ULocalPlayer* InLocalPla...,
    UWorld* InWorld
)

Functions

Name Description

Public function Const

UGameInstanc...

 

GetGameInstance()

Returns the game instance

Public function Const

AGameStateBa...

 

GetGameState()

Getter for the Game State Base

Public function Const

T *

 

GetGameState

(
    bool bCastChecked
)

Templated Getter for the Game State

Public function Const

AHUD *

 

GetHUD()

Getter for this player's HUD

Public function Const

T *

 

GetHUD

(
    bool bCastChecked
)

Templated Getter for the HUD

Public function Const

ULocalPlayer...

 

GetLocalPlayer()

Returns the local player.

Public function Const

APawn *

 

GetPawn()

Getter for the base pawn of this player

Public function Const

T *

 

GetPawn

(
    bool bCastChecked
)

Templated getter for the player's pawn

Public function Const

APlayerContr...

 

GetPlayerController()

Returns the player controller.

Public function Const

T *

 

GetPlayerController

(
    bool bCastChecked
)

Templated version of GetPlayerController()

Public function Const

APlayerState...

 

GetPlayerState()

Getter for the Player State

Public function Const

T *

 

GetPlayerState

(
    bool bCastChecked
)

Templated Getter for the Player State

Public function Const

UWorld *

 

GetWorld()

Returns the world context.

Public function Const

bool

 

IsFromLocalPlayer

(
    const AActor* ActorToTest
)

This function tests if the given Actor is connected to the Local Player in any way.

Public function Const

bool

 

IsInitialized()

Is this context initialized

Public function Const

bool

 

IsValid()

Is this context initialized and still valid?

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