class
CharacterController
Special physics controller meant to be used for game characters.
Uses the "slide-and-collide" physics instead of of the standard physics model to handle various issues with manually moving kinematic objects. Uses a capsule to represent the character's bounds.
Public
Constructors
CharacterController
Methods
Move
Moves the controller in the specified direction by the specified amount, while interacting with surrounding geometry.
Returns flags signaling where collision occurred after the movement.
Does not account for gravity, you must apply it manually.
SetFootPosition
Determines the position of the bottom of the controller.
Position takes contact offset into account. Changing this will teleport the character to the location. Use Move() for movement that includes physics.
GetFootPosition
SetRadius
Determines the radius of the controller capsule.
GetRadius
SetHeight
Determines the height between the centers of the two spheres of the controller capsule.
GetHeight
SetUp
Determines the up direction of capsule.
Determines capsule orientation.
GetUp
SetClimbingMode
Controls what happens when character encounters a height higher than its step offset.
GetClimbingMode
SetNonWalkableMode
Controls what happens when character encounters a slope higher than its slope offset.
GetNonWalkableMode
SetMinMoveDistance
Represents minimum distance that the character will move during a call to Move().
This is used to stop the recursive motion algorithm when the remaining distance is too small.
GetMinMoveDistance
SetContactOffset
Contact offset specifies a skin around the object within which contacts will be generated.
It should be a small positive non-zero value.
GetContactOffset
SetStepOffset
Controls which obstacles will the character be able to automatically step over without being stopped.
This is the height of the maximum obstacle that will be stepped over (with exceptions, see ClimbingMode).
GetStepOffset
SetSlopeLimit
Controls which slopes should the character consider too steep and won't be able to move over.
See NonWalkableMode for more information.
GetSlopeLimit
SetLayer
Determines the layer that controls what can the controller collide with.
GetLayer
staticGetRttiStatic
Fields
OnColliderHit
Triggered when the controller hits a collider.
OnControllerHit
Triggered when the controller hits another character controller.
Protected
Constructors
CharacterController
Methods
OnDestroyed
Called once just before the component is destroyed.
Called regardless of the state the component is in.
OnDisabled
Called every time a component is placed into the Stopped state.
This includes component destruction if component wasn't already in Stopped state during destruction. When called during destruction it is called before OnDestroyed.
OnEnabled
Called every time a component leaves the Stopped state, if the component is enabled.
This includes component creation if requirements for leaving the Stopped state are met. When called during creation it is called after OnBeginPlay.
OnTransformChanged
Called when the component's parent scene object has changed.
Not called if the component is in Stopped state. Also only called if necessary notify flags are set via SetNotifyFlagsInternal().
UpdateSceneObjectPositionFromController
Updates the position by copying it from the controller to the component's scene object.
UpdateDimensions
Updates the dimensions of the controller by taking account scale of the parent scene object.
DestroyInternal
Destroys the internal character controller representation.
TriggerOnColliderHit
Triggered when the internal controller hits a collider.
TriggerOnControllerHit
Triggered when the internal controller hits another controller.