UControllerComponent

ControllerComponent is an actor component made for [AController](API\Runtime\Engine\GameFramework\AController) and receives controller events.

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

ModularGameplay

Header

/Engine/Plugins/Experimental/ModularGameplay/Source/ModularGameplay/Public/Components/ControllerComponent.h

Include

#include "Components/ControllerComponent.h"

Syntax

UCLASS()
class UControllerComponent : public UGameFrameworkComponent

Remarks

ControllerComponent is an actor component made for AController and receives controller events.

Constructors

Name Description

Public function

UControllerComponent

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function Const

T *

 

GetController()

Gets the controller that owns the component, this will always be valid during gameplay but can return null in the editor

Public function Const

T *

 

GetControllerChecked()

Public function Const

T *

 

GetPawn()

Controller accessors Usable for any type of AController owner, only valid if called during gameplayReturns the pawn that is currently possessed by the owning controller, will often return null

Public function Const

T *

 

GetPawnOrViewTarget()

If this controller is possessing a pawn return the pawn, if not return the view target

Public function Const

T *

 

GetPlayer()

PlayerController accessors Only returns correct values for APlayerController owners

Public function Const

T *

 

GetPlayerState()

Returns the player state attached to this controller if there is one

Public function Const

void

 

GetPlayerViewPoint

(
    FVector& Location,
    FRotator& Rotation
)

Returns the point of view for either a player or controlled pawn

Public function Const

T *

 

GetViewTarget()

Returns the actor that is serving as the current view target for the owning controller

Public function Const

bool

 

IsLocalController()

Returns true if the owning controller is considered to be local

Public function Virtual

void

 

PlayerTick

(
    float DeltaTime
)

PlayerTick is only called if the PlayerController has a PlayerInput object.

Public function Virtual

void

 

ReceivedPlayer()

PlayerController events These only happen if the controller is a PlayerControllerCalled after the PlayerController's viewport/net connection is associated with this player controller.