Show / Hide Table of Contents

Class Controller

Controllers are non-physical actors that can possess a Pawn to control its actions.

Inheritance
System.Object
UObject
Actor
Controller
AIController
PlayerController
Inherited Members
Actor.K2_OnBecomeViewTarget
Actor.K2_OnEndViewTarget
Actor.K2_OnReset
Actor.ReceiveActorBeginCursorOver
Actor.ReceiveActorBeginOverlap
Actor.ReceiveActorEndCursorOver
Actor.ReceiveActorEndOverlap
Actor.ReceiveActorOnClicked
Actor.ReceiveActorOnInputTouchBegin
Actor.ReceiveActorOnInputTouchEnd
Actor.ReceiveActorOnInputTouchEnter
Actor.ReceiveActorOnInputTouchLeave
Actor.ReceiveActorOnReleased
Actor.ReceiveAnyDamage
Actor.ReceiveBeginPlay
Actor.ReceiveDestroyed
Actor.ReceiveEndPlay
Actor.ReceiveHit
Actor.ReceivePointDamage
Actor.ReceiveRadialDamage
Actor.ReceiveTick
Actor.UserConstructionScript
Actor.ActorHasTag(Name)
Actor.AddComponent(Name, Boolean, Transform, UObject)
Actor.AddTickPrerequisiteActor(Actor)
Actor.AddTickPrerequisiteComponent(ActorComponent)
Actor.DetachRootComponentFromParent(Boolean)
Actor.DisableInput(PlayerController)
Actor.EnableInput(PlayerController)
Actor.FlushNetDormancy()
Actor.ForceNetUpdate()
Actor.GetActorBounds(Boolean)
Actor.GetActorEnableCollision()
Actor.GetActorEyesViewPoint()
Actor.GetActorForwardVector()
Actor.GetActorLabel()
Actor.GetActorRelativeScale3D()
Actor.GetActorRightVector()
Actor.GetActorScale3D()
Actor.GetActorTickInterval()
Actor.GetActorTimeDilation()
Actor.GetActorUpVector()
Actor.GetAllChildActors(Boolean)
Actor.GetAttachedActors()
Actor.GetAttachParentActor()
Actor.GetAttachParentSocketName()
Actor.GetComponentByClass(SubclassOf<ActorComponent>)
Actor.GetComponentsByClass(SubclassOf<ActorComponent>)
Actor.GetComponentsByTag(SubclassOf<ActorComponent>, Name)
Actor.GetDistanceTo(Actor)
Actor.GetDotProductTo(Actor)
Actor.GetFolderPath(Name)
Actor.GetGameTimeSinceCreation()
Actor.GetHorizontalDistanceTo(Actor)
Actor.GetHorizontalDotProductTo(Actor)
Actor.GetInputAxisKeyValue(Key)
Actor.GetInputAxisValue(Name)
Actor.GetInputVectorAxisValue(Key)
Actor.GetInstigator()
Actor.GetInstigatorController()
Actor.GetLifeSpan()
Actor.GetLocalRole()
Actor.GetOverlappingActors(SubclassOf<Actor>)
Actor.GetOverlappingComponents()
Actor.GetOwner()
Actor.GetParentActor()
Actor.GetParentComponent()
Actor.GetRemoteRole()
Actor.GetSquaredDistanceTo(Actor)
Actor.GetTickableWhenPaused()
Actor.GetTransform()
Actor.GetVelocity()
Actor.GetVerticalDistanceTo(Actor)
Actor.HasAuthority()
Actor.IsActorBeingDestroyed()
Actor.IsActorTickEnabled()
Actor.IsChildActor()
Actor.IsEditable()
Actor.IsHiddenEd()
Actor.IsHiddenEdAtStartup()
Actor.IsOverlappingActor(Actor)
Actor.IsSelectable()
Actor.IsTemporarilyHiddenInEditor(Boolean)
Actor.K2_AddActorLocalOffset(Vector, Boolean, Boolean)
Actor.K2_AddActorLocalRotation(Rotator, Boolean, Boolean)
Actor.K2_AddActorLocalTransform(Transform, Boolean, Boolean)
Actor.K2_AddActorWorldOffset(Vector, Boolean, Boolean)
Actor.K2_AddActorWorldRotation(Rotator, Boolean, Boolean)
Actor.K2_AddActorWorldTransform(Transform, Boolean, Boolean)
Actor.K2_AttachRootComponentTo(SceneComponent, Name, Byte, Boolean)
Actor.K2_AttachRootComponentToActor(Actor, Name, Byte, Boolean)
Actor.K2_AttachToActor(Actor, Name, EAttachmentRule, EAttachmentRule, EAttachmentRule, Boolean)
Actor.K2_AttachToComponent(SceneComponent, Name, EAttachmentRule, EAttachmentRule, EAttachmentRule, Boolean)
Actor.K2_DestroyActor()
Actor.K2_DestroyComponent(ActorComponent)
Actor.K2_DetachFromActor(EDetachmentRule, EDetachmentRule, EDetachmentRule)
Actor.K2_GetActorLocation()
Actor.K2_GetActorRotation()
Actor.K2_GetRootComponent()
Actor.K2_SetActorLocation(Vector, Boolean, Boolean)
Actor.K2_SetActorLocationAndRotation(Vector, Rotator, Boolean, Boolean)
Actor.K2_SetActorRelativeLocation(Vector, Boolean, Boolean)
Actor.K2_SetActorRelativeRotation(Rotator, Boolean, Boolean)
Actor.K2_SetActorRelativeTransform(Transform, Boolean, Boolean)
Actor.K2_SetActorRotation(Rotator, Boolean)
Actor.K2_SetActorTransform(Transform, Boolean, Boolean)
Actor.K2_TeleportTo(Vector, Rotator)
Actor.MakeMIDForMaterial(MaterialInterface)
Actor.MakeNoise(Single, Pawn, Vector, Single, Name)
Actor.PrestreamTextures(Single, Boolean, Int32)
Actor.RemoveTickPrerequisiteActor(Actor)
Actor.RemoveTickPrerequisiteComponent(ActorComponent)
Actor.SetActorEnableCollision(Boolean)
Actor.SetActorHiddenInGame(Boolean)
Actor.SetActorLabel(String, Boolean)
Actor.SetActorRelativeScale3D(Vector)
Actor.SetActorScale3D(Vector)
Actor.SetActorTickEnabled(Boolean)
Actor.SetActorTickInterval(Single)
Actor.SetFolderPath(Name)
Actor.SetIsTemporarilyHiddenInEditor(Boolean)
Actor.SetLifeSpan(Single)
Actor.SetNetDormancy(Byte)
Actor.SetOwner(Actor)
Actor.SetReplicateMovement(Boolean)
Actor.SetReplicates(Boolean)
Actor.SetTickableWhenPaused(Boolean)
Actor.SetTickGroup(Byte)
Actor.SnapRootComponentTo(Actor, Name)
Actor.TearOff()
Actor.WasRecentlyRendered(Single)
Actor.PrimaryActorTick
Actor.bHidden
Actor.bNetTemporary
Actor.bNetStartup
Actor.bOnlyRelevantToOwner
Actor.bAlwaysRelevant
Actor.bReplicateMovement
Actor.bTearOff
Actor.bExchangedRoles
Actor.bNetLoadOnClient
Actor.bNetUseOwnerRelevancy
Actor.bRelevantForNetworkReplays
Actor.bReplayRewindable
Actor.bAllowTickBeforeBeginPlay
Actor.bAutoDestroyWhenFinished
Actor.bBlockInput
Actor.bCanBeDamaged
Actor.bCollideWhenPlacing
Actor.bFindCameraComponentWhenViewTarget
Actor.bGenerateOverlapEventsDuringLevelStreaming
Actor.bIgnoresOriginShifting
Actor.bEnableAutoLODGeneration
Actor.bIsEditorOnlyActor
Actor.bActorSeamlessTraveled
Actor.bReplicates
Actor.bCanBeInCluster
Actor.bAllowReceiveTickEventOnDedicatedServer
Actor.bActorEnableCollision
Actor.bActorIsBeingDestroyed
Actor.RemoteRole
Actor.ReplicatedMovement
Actor.InitialLifeSpan
Actor.CustomTimeDilation
Actor.AttachmentReplication
Actor.Owner
Actor.NetDriverName
Actor.Role
Actor.NetDormancy
Actor.AutoReceiveInput
Actor.InputPriority
Actor.InputComponent
Actor.NetCullDistanceSquared
Actor.NetTag
Actor.NetUpdateFrequency
Actor.MinNetUpdateFrequency
Actor.NetPriority
Actor.Instigator
Actor.Children
Actor.RootComponent
Actor.PivotOffset
Actor.ControllingMatineeActors
Actor.GroupActor
Actor.SpriteScale
Actor.FolderPath
Actor.bHiddenEd
Actor.bIsEditorPreviewActor
Actor.bHiddenEdLayer
Actor.bHiddenEdLevel
Actor.bLockLocation
Actor.bActorLabelEditable
Actor.bEditable
Actor.bListedInSceneOutliner
Actor.bHiddenEdTemporary
Actor.InstanceComponents
Actor.BlueprintCreatedComponents
UObject.TransientPackage
UObject.CastTo<T>(UObject)
UObject.CastTo(UObject, Type)
UObject.RemoveObject(UObject)
UObject.MakeObjectArrayField<T>(NativeArray*)
UObject.NotImplemented<T>()
UObject.Construct()
UObject.GetHashCode()
UObject.GetName()
UObject.ToString()
UObject.Name
UObject._None
UObject.None
UObject.ObjPointer
UObject.LoadObjectFromClass(Class, UObject, String, String, LoadFlags, PackageMap, Boolean)
UObject.LoadClass(Class, UObject, String, String, LoadFlags, PackageMap)
UObject.GetPropertyFor<T>(Name)
UObject.ExecuteUbergraph
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: UE4.Engine
Assembly: UE4DotNet.dll
Syntax
public class Controller : Actor
Remarks

PlayerControllers are used by human players to control pawns, while AIControllers implement the artificial intelligence for the pawns they control. Controllers take control of a pawn using their Possess() method, and relinquish control of the pawn by calling UnPossess().

Controllers receive notifications for many of the events occurring for the Pawn they are controlling. This gives the controller the opportunity to implement the behavior in response to this event, intercepting the event and superseding the Pawn's default behavior.

ControlRotation (accessed via GetControlRotation()), determines the viewing/aiming direction of the controlled Pawn and is affected by input such as from a mouse or gamepad.

@see https://docs.unrealengine.com/latest/INT/Gameplay/Framework/Controller/

Properties

| Improve this Doc View Source

bAttachToPawn

Declaration
public bool bAttachToPawn { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

bIsPlayerController

Declaration
public bool bIsPlayerController { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

Character

Character currently being controlled by this controller. Value is same as Pawn if the controlled pawn is a character, otherwise nullptr

Declaration
public Character Character { get; set; }
Property Value
Type Description
Character
| Improve this Doc View Source

ControlRotation

The control rotation of the Controller. See GetControlRotation.

Declaration
public Rotator ControlRotation { get; set; }
Property Value
Type Description
Rotator
| Improve this Doc View Source

DefaultObject

Get UE4 Default Object for this Class

Declaration
public static Controller DefaultObject { get; }
Property Value
Type Description
Controller
| Improve this Doc View Source

Pawn

Pawn currently being controlled by this controller. Use Pawn.Possess() to take control of a pawn

Declaration
public Pawn Pawn { get; set; }
Property Value
Type Description
Pawn
| Improve this Doc View Source

PlayerState

PlayerState containing replicated information about the player using this controller (only exists for players, not NPCs).

Declaration
public PlayerState PlayerState { get; }
Property Value
Type Description
PlayerState
| Improve this Doc View Source

StateName

Current gameplay state this controller is in

Declaration
public Name StateName { get; set; }
Property Value
Type Description
Name
| Improve this Doc View Source

StaticClass

Get UE4 Class

Declaration
public static Class StaticClass { get; }
Property Value
Type Description
Class
| Improve this Doc View Source

TransformComponent

Component to give controllers a transform and enable attachment if desired.

Declaration
public SceneComponent TransformComponent { get; set; }
Property Value
Type Description
SceneComponent

Methods

| Improve this Doc View Source

CastToPlayerController()

Cast to Player Controller

Declaration
public PlayerController CastToPlayerController()
Returns
Type Description
PlayerController
| Improve this Doc View Source

GetControlRotation()

Get the control rotation.

Declaration
public Rotator GetControlRotation()
Returns
Type Description
Rotator
Remarks

This is the full aim rotation, which may be different than a camera orientation (for example in a third person view), and may differ from the rotation of the controlled Pawn (which may choose not to visually pitch or roll, for example).

| Improve this Doc View Source

GetDesiredRotation()

Get the desired pawn target rotation

Declaration
public Rotator GetDesiredRotation()
Returns
Type Description
Rotator
| Improve this Doc View Source

GetViewTarget()

Get the actor the controller is looking at

Declaration
public Actor GetViewTarget()
Returns
Type Description
Actor
| Improve this Doc View Source

IsLocalController()

Returns whether this Controller is a local controller.

Declaration
public bool IsLocalController()
Returns
Type Description
System.Boolean
| Improve this Doc View Source

IsLocalPlayerController()

Returns whether this Controller is a locally controlled PlayerController.

Declaration
public bool IsLocalPlayerController()
Returns
Type Description
System.Boolean
| Improve this Doc View Source

IsLookInputIgnored()

Returns true if look input is ignored.

Declaration
public bool IsLookInputIgnored()
Returns
Type Description
System.Boolean
| Improve this Doc View Source

IsMoveInputIgnored()

Returns true if movement input is ignored.

Declaration
public bool IsMoveInputIgnored()
Returns
Type Description
System.Boolean
| Improve this Doc View Source

IsPlayerController()

Returns whether this Controller is a PlayerController.

Declaration
public bool IsPlayerController()
Returns
Type Description
System.Boolean
| Improve this Doc View Source

K2_GetPawn()

Return the Pawn that is currently 'controlled' by this PlayerController

Declaration
public Pawn K2_GetPawn()
Returns
Type Description
Pawn
| Improve this Doc View Source

LineOfSightTo(Actor, Vector, Boolean)

Checks line to center and top of other actor @

Declaration
public bool LineOfSightTo(Actor Other, Vector ViewPoint, bool bAlternateChecks)
Parameters
Type Name Description
Actor Other
Vector ViewPoint
System.Boolean bAlternateChecks
Returns
Type Description
System.Boolean
Remarks

param Other is the actor whose visibility is being checked. @param ViewPoint is eye position visibility is being checked from. If vect(0,0,0) passed in, uses current viewtarget's eye position. @param bAlternateChecks used only in AIController implementation @return true if controller's pawn can see Other actor.

| Improve this Doc View Source

New(UObject, Name)

Spawn an object of this class

Declaration
public static Controller New(UObject obj = null, Name name = default(Name))
Parameters
Type Name Description
UObject obj
Name name
Returns
Type Description
Controller
| Improve this Doc View Source

Possess(Pawn)

Handles attaching this controller to the specified pawn.

Declaration
public void Possess(Pawn InPawn)
Parameters
Type Name Description
Pawn InPawn
Remarks

Only runs on the network authority (where HasAuthority() returns true). @param InPawn The Pawn to be possessed. @see HasAuthority()

| Improve this Doc View Source

ResetIgnoreInputFlags()

Reset move and look input ignore flags.

Declaration
public void ResetIgnoreInputFlags()
| Improve this Doc View Source

ResetIgnoreLookInput()

Stops ignoring look input by resetting the ignore look input state.

Declaration
public void ResetIgnoreLookInput()
| Improve this Doc View Source

ResetIgnoreMoveInput()

Stops ignoring move input by resetting the ignore move input state.

Declaration
public void ResetIgnoreMoveInput()
| Improve this Doc View Source

SetControlRotation(Rotator)

Set the control rotation.

Declaration
public void SetControlRotation(Rotator NewRotation)
Parameters
Type Name Description
Rotator NewRotation
| Improve this Doc View Source

SetIgnoreLookInput(Boolean)

Locks or unlocks look input, consecutive calls stack up and require the same amount of calls to undo, or can all be undone using ResetIgnoreLookInput.

Declaration
public void SetIgnoreLookInput(bool bNewLookInput)
Parameters
Type Name Description
System.Boolean bNewLookInput
Remarks

@param bNewLookInput If true, look input is ignored. If false, input is not ignored.

| Improve this Doc View Source

SetIgnoreMoveInput(Boolean)

Locks or unlocks movement input, consecutive calls stack up and require the same amount of calls to undo, or can all be undone using ResetIgnoreMoveInput.

Declaration
public void SetIgnoreMoveInput(bool bNewMoveInput)
Parameters
Type Name Description
System.Boolean bNewMoveInput
Remarks

@param bNewMoveInput If true, move input is ignored. If false, input is not ignored.

| Improve this Doc View Source

SetInitialLocationAndRotation(Vector, Rotator)

Set the initial location and rotation of the controller, as well as the control rotation. Typically used when the controller is first created.

Declaration
public void SetInitialLocationAndRotation(Vector NewLocation, Rotator NewRotation)
Parameters
Type Name Description
Vector NewLocation
Rotator NewRotation
| Improve this Doc View Source

StopMovement()

Aborts the move the controller is currently performing

Declaration
public void StopMovement()
| Improve this Doc View Source

UnPossess()

Called to unpossess our pawn for any reason that is not the pawn being destroyed (destruction handled by PawnDestroyed()).

Declaration
public void UnPossess()

Events

| Improve this Doc View Source

ReceiveInstigatedAnyDamage

Event when this controller instigates ANY damage

Declaration
public event Controller.ReceiveInstigatedAnyDamage_delegate ReceiveInstigatedAnyDamage
Event Type
Type Description
Controller.ReceiveInstigatedAnyDamage_delegate

Operators

| Improve this Doc View Source

Implicit(IntPtr to Controller)

Convert from IntPtr to UObject

Declaration
public static implicit operator Controller(IntPtr p)
Parameters
Type Name Description
System.IntPtr p
Returns
Type Description
Controller
  • Improve this Doc
  • View Source
Back to top Generated by DocFX