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?

Select Skin
Light
Dark

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