UCharacterMovementComponent

CharacterMovementComponent handles movement logic for the associated Character owner.

Inheritance Hierarchy

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/GameFramework/CharacterMovementComponent.h

Include

#include "GameFramework/CharacterMovementComponent.h"

Syntax

class UCharacterMovementComponent :
    public UPawnMovementComponent,
    public IRVOAvoidanceInterface,
    public INetworkPredictionInterface

Remarks

CharacterMovementComponent handles movement logic for the associated Character owner. It supports various movement modes including: walking, falling, swimming, flying, custom.

Movement is affected primarily by current Velocity and Acceleration. Acceleration is updated each frame based on the input vector accumulated thus far (see UPawnMovementComponent::GetPendingInputVector()).

Networking is fully implemented, with server-client correction and prediction included.

Variables

Name Description

Protected variable

FVector

 

Acceleration

Current acceleration vector (with magnitude).

Public variable

float

 

AirControl

When falling, amount of lateral movement control available to the character.

Public variable

float

 

AirControlBoostMultiplier

When falling, multiplier applied to AirControl when lateral velocity is less than AirControlBoostVelocityThreshold.

Public variable

float

 

AirControlBoostVelocityThreshold

When falling, if lateral velocity magnitude is less than this value, AirControl is multiplied by AirControlBoostMultiplier.

Protected variable

float

 

AnalogInputModifier

Modifier to applied to values such as acceleration and max speed due to analog input.

Public variable

FVector

 

AnimRootMotionVelocity

Velocity extracted from RootMotionParams when there is anim root motion active.

Public variable

FRootMotionAsyn...

 

AsyncRootMotion

Protected variable

TSharedPtr< FCh...

 

AsyncSimState

This is the most recent async state from simulated. Only safe for access on physics thread.

Public variable

float

 

AvoidanceConsiderationRadius

Public variable

FNavAvoidanceMa...

 

AvoidanceGroup

Moving actor's group mask

Protected variable

float

 

AvoidanceLockTimer

Remaining time of avoidance velocity lock

Protected variable

FVector

 

AvoidanceLockVelocity

Forced avoidance velocity, used when AvoidanceLockTimer is > 0

Public variable

int32

 

AvoidanceUID

No default value, for now it's assumed to be valid if GetAvoidanceManager() returns non-NULL.

Public variable

float

 

AvoidanceWeight

De facto default value 0.5 (due to that being the default in the avoidance registration function), indicates RVO behavior.

Public variable

uint8: 1

 

bAllowPhysicsRotationDuringAnimRootMotion

Public variable

uint8: 1

 

bAlwaysCheckFloor

Whether we always force floor checks for stationary Characters while walking.

Public variable

uint8: 1

 

bApplyGravityWhileJumping

Apply gravity while the character is actively jumping (e.g. holding the jump key).

Public variable

bool

 

bCanTrustClientOnLanding

Whether we're stepping off a moving platform (and should trust the client somewhat when landing).

Public variable

uint8: 1

 

bCanWalkOffLedges

If true, Character can walk off a ledge.

Public variable

uint8: 1

 

bCanWalkOffLedgesWhenCrouching

If true, Character can walk off a ledge when crouching.

Public variable

uint8: 1

 

bCheatFlying

Instantly stop when in flying mode and no acceleration is being applied.

Public variable

uint8: 1

 

bCrouchMaintainsBaseLocation

If true, crouching should keep the base of the capsule in place by lowering the center of the shrunken capsule.

Protected variable

uint8: 1

 

bDeferUpdateBasedMovement

Flag set in pre-physics update to indicate that based movement should be updated post-physics

Public variable

uint8: 1

 

bDeferUpdateMoveComponent

True to update CharacterOwner and UpdatedComponent after movement ends

Public variable

uint8: 1

 

bEnablePhysicsInteraction

If enabled, the player will interact with physics objects when walking into them.

Public variable

uint8: 1

 

bEnableScopedMovementUpdates

If true, high-level movement updates will be wrapped in a movement scope that accumulates updates and defers a bulk of the work until the end.

Public variable

uint8: 1

 

bEnableServerDualMoveScopedMovementUpdates

Optional scoped movement update to combine moves for cheaper performance on the server when the client sends two moves in one packet.

Public variable

uint8: 1

 

bFastAttachedMove

Set this to true if riding on a moving base that you know is clear from non-moving world obstructions.

Public variable

uint8: 1

 

bForceMaxAccel

Ignores size of acceleration component, and forces max acceleration to drive character at full velocity.

Public variable

uint8: 1

 

bForceNextFloorCheck

Force the Character in MOVE_Walking to do a check for a valid floor even if it hasn't moved.

Protected variable

uint8: 1

 

bHasRequestedVelocity

Was velocity requested by path following?

Public variable

uint8: 1

 

bIgnoreBaseRotation

Whether the character ignores changes in rotation of the base it is standing on.

Public variable

uint8: 1

 

bIgnoreClientMovementErrorChecksAndCorrection

If true, we should ignore server location difference checks for client error on this movement component.

Public variable

uint8: 1

 

bImpartBaseAngularVelocity

If true, impart the base component's tangential components of angular velocity when jumping or falling off it.

Public variable

uint8: 1

 

bImpartBaseVelocityX

If true, impart the base actor's X velocity when falling off it (which includes jumping)

Public variable

uint8: 1

 

bImpartBaseVelocityY

If true, impart the base actor's Y velocity when falling off it (which includes jumping)

Public variable

uint8: 1

 

bImpartBaseVelocityZ

If true, impart the base actor's Z velocity when falling off it (which includes jumping)

Public variable

uint8: 1

 

bIsNavWalkingOnServer

Set on clients when server's movement mode is NavWalking

Public variable

uint8: 1

 

bJustTeleported

Used by movement code to determine if a change in position is based on normal movement or a teleport.

Public variable

bool

 

bLastClientIsFalling

Remember if the client was previously falling so we can tell when they've just landed.

Public variable

bool

 

bLastServerIsFalling

Remember if the server was previously falling so we can tell when they've just landed.

Public variable

bool

 

bLastServerIsWalking

Whether we were just walking on something, used to help with transitions off moving objects.

Public variable

uint8: 1

 

bMaintainHorizontalGroundVelocity

If true, walking movement always maintains horizontal velocity when moving up ramps, which causes movement up ramps to be faster parallel to the ramp surface.

Protected variable

uint8: 1

 

bMovementInProgress

True during movement update.

Protected variable

bool

 

bMovementModeDirty

Public variable

uint8: 1

 

bNetworkAlwaysReplicateTransformUpdateTimestamp

Flag used on the server to determine whether to always replicate ReplicatedServerLastTransformUpdateTimeStamp to clients.

Public variable

uint8: 1

 

bNetworkGravityDirectionChanged

True when the networked gravity direction has been replicated.

Public variable

uint8: 1

 

bNetworkLargeClientCorrection

Flag indicating the client correction was larger than NetworkLargeClientCorrectionThreshold.

Public variable

uint8: 1

 

bNetworkMovementModeChanged

True when the networked movement mode has been replicated.

Public variable

uint8: 1

 

bNetworkSkipProxyPredictionOnNetUpdate

Whether we skip prediction on frames where a proxy receives a network update.

Public variable

uint8: 1

 

bNetworkSmoothingComplete

Signals that smoothed position/rotation has reached target, and no more smoothing is necessary until a future update.

Public variable

uint8: 1

 

bNetworkUpdateReceived

True when a network replication update is received for simulated proxies.

Public variable

uint8: 1

 

bNotifyApex

If true, event NotifyJumpApex() to CharacterOwner's controller when at apex of jump.

Public variable

uint8: 1

 

bOrientRotationToMovement

If true, rotate the Character toward the direction of acceleration, using RotationRate as the rate of rotation change.

Public variable

uint8: 1

 

bPerformingJumpOff

Used to prevent reentry of JumpOff()

Protected variable

uint8: 1

 

bProjectNavMeshOnBothWorldChannels

Use both WorldStatic and WorldDynamic channels for NavWalking geometry conforming

Protected variable

uint8: 1

 

bProjectNavMeshWalking

Whether to raycast to underlying geometry to better conform navmesh-walking characters

Public variable

uint8: 1

 

bPushForceScaledToMass

If enabled, the PushForceFactor is applied per kg mass of the affected object.

Public variable

uint8: 1

 

bPushForceUsingZOffset

If enabled, the PushForce location is moved using PushForcePointZOffsetFactor.

Public variable

float

 

BrakingDecelerationFalling

Lateral deceleration when falling and not applying acceleration.

Public variable

float

 

BrakingDecelerationFlying

Deceleration when flying and not applying acceleration.

Public variable

float

 

BrakingDecelerationSwimming

Deceleration when swimming and not applying acceleration.

Public variable

float

 

BrakingDecelerationWalking

Deceleration when walking and not applying acceleration.

Public variable

float

 

BrakingFriction

Friction (drag) coefficient applied when braking (whenever Acceleration = 0, or if character is exceeding max speed); actual value used is this multiplied by BrakingFrictionFactor.

Public variable

float

 

BrakingFrictionFactor

Factor used to multiply actual value of friction used when braking.

Public variable

float

 

BrakingSubStepTime

Time substepping when applying braking friction.

Public variable

uint8: 1

 

bRequestedMoveUseAcceleration

Should use acceleration for path following? If true, acceleration is applied when path following to reach the target velocity.

Protected variable

uint8: 1

 

bRequestedMoveWithMaxSpeed

Was acceleration requested to be always max speed?

Public variable

uint8: 1

 

bRunPhysicsWithNoController

If true, movement will be performed even if there is no Controller for the Character owner.

Public variable

uint8: 1

 

bScalePushForceToVelocity

If enabled, the applied push force will try to get the physics object to the same velocity than the player, not faster.

Public variable

uint8: 1

 

bServerAcceptClientAuthoritativePosition

If true, and server does not detect client position error, server will copy the client movement location/velocity/etc after simulating the move.

Public variable

uint8: 1

 

bShrinkProxyCapsule

If true, the capsule needs to be shrunk on this simulated proxy, to avoid replication rounding putting us in geometry.

Public variable

uint8: 1

 

bSweepWhileNavWalking

Whether or not the character should sweep for collision geometry while walking.

Public variable

bool

 

bTeleportedSinceLastUpdate

True if the UpdatedComponent was moved outside of this CharacterMovementComponent since the last move its starting location for this update doesn't match its ending position for the previous update.

Public variable

uint8: 1

 

bTouchForceScaledToMass

If enabled, the TouchForceFactor is applied per kg mass of the affected object.

Public variable

float

 

Buoyancy

Water buoyancy. A ratio (1.0 = neutral buoyancy, 0.0 = no buoyancy)

Public variable

uint8: 1

 

bUseControllerDesiredRotation

If true, smoothly rotate the Character toward the Controller's desired rotation (typically Controller->ControlRotation), using RotationRate as the rate of rotation change.

Public variable

uint8: 1

 

bUseFlatBaseForFloorChecks

Performs floor checks as if the character is using a shape with a flat base.

Public variable

uint8: 1

 

bUseRVOAvoidance

If set, component will use RVO avoidance. This only runs on the server.

Protected variable

uint8: 1

 

bUseRVOPostProcess

If set, PostProcessAvoidanceVelocity will be called

Public variable

uint8: 1

 

bUseSeparateBrakingFriction

If true, BrakingFriction will be used to slow the character to a stop (when there is no Acceleration).

Public variable

uint8: 1

 

bWantsToCrouch

If true, try to crouch (or keep crouching) on next update.

Public variable

uint8: 1

 

bWantsToLeaveNavWalking

Used to safely leave NavWalking movement mode

Protected variable

uint8: 1

 

bWasAvoidanceUpdated

Was avoidance updated in this frame?

Public variable

uint8: 1

 

bWasSimulatingRootMotion

True when SimulatedProxies are simulating RootMotion

Public variable

FNavLocation

 

CachedNavLocation

Last known location projected on navmesh, used by NavWalking mode

Public variable

FHitResult

 

CachedProjectedNavMeshHitResult

Last valid projected hit result from raycast to geometry from navmesh

Protected variable

TObjectPtr< ACh...

 

CharacterOwner

Character movement component belongs to

Protected variable

FNetworkPredict...

 

ClientPredictionData

Public variable

float

 

CrouchedHalfHeight

Collision half-height when crouching (component scale is applied separately)

Public variable

FFindFloorResul...

 

CurrentFloor

Information about the floor the Character is standing on (updated only during walking movement).

Public variable

FRootMotionSour...

 

CurrentRootMotion

Root Motion Group containing active root motion sources being applied to movement

Public variable

uint8

 

CustomMovementMode

Current custom sub-mode if MovementMode is set to Custom.

Public variable

FVector

 

DecayingFormerBaseVelocity

Left over velocity when leaving a moving base. Helps with airborne root motion.

Public variable

TEnumAsByte< en...

 

DefaultLandMovementMode

Default movement mode when not in water. Used at player startup or when teleported.

Public variable

TEnumAsByte< en...

 

DefaultWaterMovementMode

Default movement mode when in water. Used at player startup or when teleported.

Public variable

TObjectPtr< USc...

 

DeferredUpdatedMoveComponent

What to update CharacterOwner and UpdatedComponent after movement ends

Public variable

float

 

FallingLateralFriction

Friction to apply to lateral air movement when falling.

Public variable

float

 

FormerBaseVelocityDecayHalfLife

When applying a root motion override while falling off a moving object, this controls how long it takes to lose half the former base's velocity (in seconds).

Public variable

float

 

GravityScale

Custom gravity scale. Gravity is multiplied by this amount for the character.

Public variable

float

 

GroundFriction

Setting that affects movement control.

Public variable

FNavAvoidanceMa...

 

GroupsToAvoid

Will avoid other agents if they are in one of specified groups

Public variable

FNavAvoidanceMa...

 

GroupsToIgnore

Will NOT avoid other agents if they are in one of specified groups, higher priority than GroupsToAvoid

Public variable

float

 

InitialPushForceFactor

Initial impulse force to apply when the player bounces into a blocking physics object.

Public variable

float

 

JumpOffJumpZFactor

Fraction of JumpZVelocity to use when automatically "jumping off" of a base actor that's not allowed to be a base for a character.

Public variable

float

 

JumpOutOfWaterPitch

When exiting water, jump if control pitch angle is this high or above.

Public variable

float

 

JumpZVelocity

Initial velocity (instantaneous vertical acceleration) when jumping.

Public variable

FName

 

LastServerMovementBaseBoneName

Remember last server movement base bone so we can detect mounts/dismounts and respond accordingly.

Protected variable

float

 

LastStuckWarningTime

Used for throttling "stuck in geometry" logging.

Protected variable

float

 

LastTimeStampResetServerTime

Clock time on the server of the last timestamp reset.

Protected variable

FVector

 

LastUpdateLocation

Location after last PerformMovement or SimulateMovement update.

Public variable

FVector

 

LastUpdateRequestedVelocity

Velocity requested by path following during last Update Updated when we consume the value

Protected variable

FQuat

 

LastUpdateRotation

Rotation after last PerformMovement or SimulateMovement update.

Protected variable

FVector

 

LastUpdateVelocity

Velocity after last PerformMovement or SimulateMovement update.

Public variable

float

 

LedgeCheckThreshold

Used in determining if pawn is going off ledge.

Public variable

float

 

ListenServerNetworkSimulatedSmoothLocationTime

Similar setting as NetworkSimulatedSmoothLocationTime but only used on Listen servers.

Public variable

float

 

ListenServerNetworkSimulatedSmoothRotationTime

Similar setting as NetworkSimulatedSmoothRotationTime but only used on Listen servers.

Public variable

float

 

Mass

Mass of pawn (for when momentum is imparted to it).

Public variable

float

 

MaxAcceleration

Max Acceleration (rate of change of velocity)

Public variable

float

 

MaxCustomMovementSpeed

The maximum speed when using Custom movement mode.

Public variable

float

 

MaxDepenetrationWithGeometry

Max distance we allow simulated proxies to depenetrate when moving out of anything but Pawns.

Public variable

float

 

MaxDepenetrationWithGeometryAsProxy

Max distance we allow simulated proxies to depenetrate when moving out of anything but Pawns.

Public variable

float

 

MaxDepenetrationWithPawn

Max distance we are allowed to depenetrate when moving out of other Pawns.

Public variable

float

 

MaxDepenetrationWithPawnAsProxy

Max distance we allow simulated proxies to depenetrate when moving out of other Pawns.

Public variable

float

 

MaxFlySpeed

The maximum flying speed.

Public variable

int32

 

MaxJumpApexAttemptsPerSimulation

Max number of attempts per simulation to attempt to exactly reach the jump apex when falling movement reaches the top of the arc.

Public variable

float

 

MaxOutOfWaterStepHeight

Maximum step height for getting out of water

Public variable

float

 

MaxServerClientErrorWhileFalling

How loosely the client can follow the server location during this fall.

Public variable

int32

 

MaxSimulationIterations

Max number of iterations used for each discrete simulation step.

Public variable

float

 

MaxSimulationTimeStep

Max time delta for each discrete simulation step.

Public variable

float

 

MaxStepHeight

Maximum height character can step up

Public variable

float

 

MaxSwimSpeed

The maximum swimming speed.

Public variable

float

 

MaxTouchForce

Maximum force applied to touched physics objects. If < 0.0f, there is no maximum.

Public variable

float

 

MaxWalkSpeed

The maximum ground speed when walking. Also determines maximum lateral speed when falling.

Public variable

float

 

MaxWalkSpeedCrouched

The maximum ground speed when walking and crouched.

Public variable

float

 

MinAnalogWalkSpeed

The ground speed that we should accelerate up to when walking at minimum analog stick tilt

Public variable

float

 

MinTimeBetweenTimeStampResets

Minimum time between client TimeStamp resets.

Public variable

float

 

MinTouchForce

Minimum Force applied to touched physics objects. If < 0.0f, there is no minimum.

Public variable

TEnumAsByte< en...

 

MovementMode

Actor's current movement mode (walking, falling, etc).

Public variable

float

 

NavMeshProjectionHeightScaleDown

Scale of the total capsule height to use for projection from navmesh to underlying geometry in the downward direction.

Public variable

float

 

NavMeshProjectionHeightScaleUp

Scale of the total capsule height to use for projection from navmesh to underlying geometry in the upward direction.

Public variable

float

 

NavMeshProjectionInterpSpeed

Speed at which to interpolate agent navmesh offset between traces.

Public variable

float

 

NavMeshProjectionInterval

How often we should raycast to project from navmesh to underlying geometry

Public variable

float

 

NavMeshProjectionTimer

Public variable

float

 

NavWalkingFloorDistTolerance

Ignore small differences in ground height between server and client data during NavWalking mode

Public variable

float

 

NetProxyShrinkHalfHeight

Shrink simulated proxy capsule half height by this amount, to account for network rounding that may cause encroachment.

Public variable

float

 

NetProxyShrinkRadius

Shrink simulated proxy capsule radius by this amount, to account for network rounding that may cause encroachment.

Public variable

float

 

NetworkLargeClientCorrectionDistance

If client error is larger than this, sets bNetworkLargeClientCorrection to reduce delay between client adjustments.

Public variable

float

 

NetworkMaxSmoothUpdateDistance

Maximum distance character is allowed to lag behind server location when interpolating between updates.

Public variable

float

 

NetworkMinTimeBetweenClientAckGoodMoves

Minimum time on the server between acknowledging good client moves.

Public variable

float

 

NetworkMinTimeBetweenClientAdjustments

Minimum time on the server between sending client adjustments when client has exceeded allowable position error.

Public variable

float

 

NetworkMinTimeBetweenClientAdjustmentsLargeCorrection

Minimum time on the server between sending client adjustments when client has exceeded allowable position error by a large amount (NetworkLargeClientCorrectionDistance).

Public variable

float

 

NetworkNoSmoothUpdateDistance

Maximum distance beyond which character is teleported to the new server location without any smoothing.

Public variable

float

 

NetworkSimulatedSmoothLocationTime

How long to take to smoothly interpolate from the old pawn position on the client to the corrected one sent by the server.

Public variable

float

 

NetworkSimulatedSmoothRotationTime

How long to take to smoothly interpolate from the old pawn rotation on the client to the corrected one sent by the server.

Public variable

ENetworkSmoothi...

 

NetworkSmoothingMode

Smoothing mode for simulated proxies in network game.

Protected variable

int32

 

NumJumpApexAttempts

Used to limit number of jump apex attempts per tick.

Public variable

FVector

 

OldBaseLocation

Saved location of object we are standing on, for UpdateBasedMovement() to determine if base moved in the last frame, and therefore pawn needs an update.

Public variable

FQuat

 

OldBaseQuat

Saved location of object we are standing on, for UpdateBasedMovement() to determine if base moved in the last frame, and therefore pawn needs an update.

Public variable

float

 

OutofWaterZ

Z velocity applied when pawn tries to get out of water

Protected variable

FVector

 

PendingForceToApply

Accumulated force to be added next tick.

Protected variable

FVector

 

PendingImpulseToApply

Accumulated impulse to be added next tick.

Public variable

FVector

 

PendingLaunchVelocity

Temporarily holds launch velocity when pawn is to be launched so it happens at end of movement.

Public variable

float

 

PerchAdditionalHeight

When perching on a ledge, add this additional distance to MaxStepHeight when determining how high above a walkable floor we can perch.

Public variable

float

 

PerchRadiusThreshold

Don't allow the character to perch on the edge of a surface if the contact is this close to the edge of the capsule.

Public variable

FCharacterMovem...

 

PostPhysicsTickFunction

Post-physics tick function for this character

Public variable

FCharacterMovem...

 

PrePhysicsTickFunction

Pre-physics tick function for this character

Public variable

FOnProcessRootM...

 

ProcessRootMotionPostConvertToWorld

Delegate for modifying root motion post conversion from component space to world space.

Public variable

FOnProcessRootM...

 

ProcessRootMotionPreConvertToWorld

Delegate for modifying root motion pre conversion from component space to world space.

Public variable

float

 

PushForceFactor

Force to apply when the player collides with a blocking physics object.

Public variable

float

 

PushForcePointZOffsetFactor

Z-Offset for the position the force is applied to.

Protected variable

FRandomStream

 

RandomStream

Public variable

float

 

RepulsionForce

Force per kg applied constantly to all overlapping components.

Public variable

FVector

 

RequestedVelocity

Velocity requested by path following.

Public variable

TArray< FRootMo...

 

RootMotionIDMappings

Public variable

FRootMotionMove...

 

RootMotionParams

Animation root motion (special case for now)Root Motion movement params.

Public variable

FRotator

 

RotationRate

Change in rotation per second, used when UseControllerDesiredRotation or OrientRotationToMovement are true.

Public variable

FRootMotionSour...

 

ServerCorrectionRootMotion

Protected variable

float

 

ServerLastClientAdjustmentTime

Timestamp of last client adjustment sent. See NetworkMinTimeBetweenClientAdjustments.

Protected variable

float

 

ServerLastClientGoodMoveAckTime

Timestamp of last client adjustment sent. See NetworkMinTimeBetweenClientAdjustments.

Protected variable

float

 

ServerLastTransformUpdateTimeStamp

Timestamp when location or rotation last changed during an update. Only valid on the server.

Protected variable

FNetworkPredict...

 

ServerPredictionData

Public variable

float

 

StandingDownwardForceScale

Force applied to objects we stand on (due to Mass and Gravity) is scaled by this amount.

Protected variable

uint32

 

StuckWarningCountSinceNotify

Used when throttling "stuck in geometry" logging, to output the number of events we skipped if throttling.

Public variable

float

 

TouchForceFactor

Force to apply to physics objects that are touched by the player.

Constructors

Name Description

Public function

UCharacterMovementComponent

(
    const FObjectInitializer& ObjectIn...
)

Default UObject constructor.

Functions

Name Description

Protected function Virtual

void

 

AccumulateRootMotionForAsync

(
    float DeltaSeconds,
    FRootMotionAsyncData& RootMotion
)

Prepare root motion to be passed on to physics thread

Public function Virtual

void

 

AddForce

(
    FVector Force
)

Add force to character.

Public function Virtual

void

 

AddImpulse

(
    FVector Impulse,
    bool bVelocityChange
)

Add impulse to character.

Public function Static

void

 

AddReferencedObjects

(
    UObject* InThis,
    FReferenceCollector& Collector
)

Public function Virtual

void

 

AdjustFloorHeight()

Adjust distance from floor, trying to maintain a slight offset from the floor when walking (based on CurrentFloor).

Protected function Virtual

void

 

AdjustProxyCapsuleSize()

Adjust the size of the capsule on simulated proxies, to avoid overlaps due to replication rounding.

Public function Virtual

void

 

ApplyAccumulatedForces

(
    float DeltaSeconds
)

Applies momentum accumulated through AddImpulse() and AddForce(), then clears those forces.

Protected function Virtual

void

 

ApplyAsyncOutput

Apply outputs from async sim.

Public function Virtual

void

 

ApplyDownwardForce

(
    float DeltaSeconds
)

Applies downward force when walking on top of physics objects.

Protected function Virtual

void

 

ApplyImpactPhysicsForces

(
    const FHitResult& Impact,
    const FVector& ImpactAcceleration,
    const FVector& ImpactVelocity
)

Apply physics forces to the impacted component, if bEnablePhysicsInteraction is true.

Public function Virtual

void

 

ApplyNetworkMovementMode

(
    const uint8 ReceivedMode
)

Public function Virtual

void

 

ApplyRepulsionForce

(
    float DeltaSeconds
)

Applies repulsion force to all touched components.

Public function Virtual

bool

 

ApplyRequestedMove

(
    float DeltaTime,
    float MaxAccel,
    float MaxSpeed,
    float Friction,
    float BrakingDeceleration,
    FVector& OutAcceleration,
    float& OutRequestedSpeed
)

Use velocity requested by path following to compute a requested acceleration and speed.

Public function

uint16

 

ApplyRootMotionSource

(
    TSharedPtr< FRootMotionSource > Sou...
)

Apply a RootMotionSource to current root motion

Protected function Virtual

void

 

ApplyRootMotionToVelocity

(
    float deltaTime
)

Applies root motion from root motion sources to velocity (override and additive)

Protected function Virtual

void

 

ApplyVelocityBraking

(
    float DeltaTime,
    float Friction,
    float BrakingDeceleration
)

Slows towards stop.

Protected function Virtual

float

 

BoostAirControl

(
    float DeltaTime,
    float TickAirControl,
    const FVector& FallAcceleration
)

Increase air control if conditions of AirControlBoostMultiplier and AirControlBoostVelocityThreshold are met.

Protected function Virtual

void

 

BuildAsyncInput()

Public function Virtual Const

FVector

 

CalcAnimRootMotionVelocity

(
    const FVector& RootMotionDeltaMove,
    float DeltaSeconds,
    const FVector& CurrentVelocity
)

Calculate velocity from anim root motion.

Public function Virtual

void

 

CalcAvoidanceVelocity

(
    float DeltaTime
)

Calculate RVO avoidance and apply it to current velocity

Public function Virtual

void

 

CalcVelocity

(
    float DeltaTime,
    float Friction,
    bool bFluid,
    float BrakingDeceleration
)

Updates Velocity and Acceleration based on the current state, applying the effects of friction and acceleration or deceleration.

Protected function Virtual

void

 

CallMovementUpdateDelegate

(
    float DeltaSeconds,
    const FVector& OldLocation,
    const FVector& OldVelocity
)

Internal function to call OnMovementUpdated delegate on CharacterOwner.

Protected function Virtual

void

 

CallServerMove

(
    const FSavedMove_Character* Ne...,
    const FSavedMove_Character* Ol...
)

Call the appropriate replicated ServerMove() function to send a client player move to the server.

Protected function Virtual

void

 

CallServerMovePacked

(
    const FSavedMove_Character* Ne...,
    const FSavedMove_Character* Pe...,
    const FSavedMove_Character* Ol...
)

On the client, calls the ServerMovePacked_ClientSend() function with packed movement data.

Public function Virtual Const

bool

 

CanAttemptJump()

Returns true if current movement state allows an attempt at jumping. Used by Character::CanJump().

Public function Virtual Const

bool

 

CanCrouchInCurrentState()

Returns true if the character is allowed to crouch in the current state.

Protected function Virtual

bool

 

CanDelaySendingMove

(
    const FSavedMovePtr& NewMove
)

Return true if it is OK to delay sending this player movement to the server, in order to conserve bandwidth.

Public function Virtual Const

bool

 

CanStepUp

(
    const FHitResult& Hit
)

Returns true if we can step up on the actor in the given FHitResult.

Public function Virtual Const

bool

 

CanWalkOffLedges()

Returns whether this pawn is currently allowed to walk off ledges

Protected function Virtual

void

 

CapsuleTouched

(
    UPrimitiveComponent* Overlappe...,
    AActor* Other,
    UPrimitiveComponent* OtherComp,
    int32 OtherBodyIndex,
    bool bFromSweep,
    const FHitResult& SweepResult
)

Called when the collision capsule touches another primitive component

Public function Virtual

bool

 

CheckFall

(
    const FFindFloorResult& OldFloor,
    const FHitResult& Hit,
    const FVector& Delta,
    const FVector& OldLocation,
    float remainingTime,
    float timeTick,
    int32 Iterations,
    bool bMustJump
)

Check if pawn is falling

Public function Virtual Const

bool

 

CheckLedgeDirection

(
    const FVector& OldLocation,
    const FVector& SideStep,
    const FVector& GravDir
)

Returns true if there is a suitable floor SideStep from current position.

Public function Virtual

bool

 

CheckWaterJump

(
    FVector CheckPoint,
    FVector& WallNormal
)

Check if swimming pawn just ran into edge of the pool and should jump out.

Public function Virtual

void

 

ClearAccumulatedForces()

Clears forces accumulated through AddImpulse() and AddForce(), and also pending launch velocity.

Public function Virtual

void

 

ClientAckGoodMove

(
    float TimeStamp
)

If no client adjustment is needed after processing received ServerMove(), ack the good move so client can remove it from SavedMoves

Public function Virtual

void

 

ClientAckGoodMove_Implementation

(
    float TimeStamp
)

If no client adjustment is needed after processing received ServerMove(), ack the good move so client can remove it from SavedMoves

Public function Virtual

void

 

ClientAdjustPosition

(
    float TimeStamp,
    FVector NewLoc,
    FVector NewVel,
    UPrimitiveComponent* NewBase,
    FName NewBaseBoneName,
    bool bHasBase,
    bool bBaseRelativePosition,
    uint8 ServerMovementMode
)

Replicate position correction to client, associated with a timestamped servermove.

Public function Virtual

void

 

ClientAdjustPosition_Implementation

(
    float TimeStamp,
    FVector NewLoc,
    FVector NewVel,
    UPrimitiveComponent* NewBase,
    FName NewBaseBoneName,
    bool bHasBase,
    bool bBaseRelativePosition,
    uint8 ServerMovementMode,
    TOptional< FRotator > OptionalRotat...
)

Replicate position correction to client, associated with a timestamped servermove.

Public function Virtual

void

 

ClientAdjustRootMotionPosition

(
    float TimeStamp,
    float ServerMontageTrackPosition,
    FVector ServerLoc,
    FVector_NetQuantizeNormal ServerRot...,
    float ServerVelZ,
    UPrimitiveComponent* ServerBas...,
    FName ServerBoneName,
    bool bHasBase,
    bool bBaseRelativePosition,
    uint8 ServerMovementMode
)

Replicate position correction to client when using root motion for movement.

Public function Virtual

void

 

ClientAdjustRootMotionPosition_Implementation

(
    float TimeStamp,
    float ServerMontageTrackPosition,
    FVector ServerLoc,
    FVector_NetQuantizeNormal ServerRot...,
    float ServerVelZ,
    UPrimitiveComponent* ServerBas...,
    FName ServerBoneName,
    bool bHasBase,
    bool bBaseRelativePosition,
    uint8 ServerMovementMode
)

Replicate position correction to client when using root motion for movement.

Public function Virtual

void

 

ClientAdjustRootMotionSourcePosition

(
    float TimeStamp,
    FRootMotionSourceGroup ServerRootMo...,
    bool bHasAnimRootMotion,
    float ServerMontageTrackPosition,
    FVector ServerLoc,
    FVector_NetQuantizeNormal ServerRot...,
    float ServerVelZ,
    UPrimitiveComponent* ServerBas...,
    FName ServerBoneName,
    bool bHasBase,
    bool bBaseRelativePosition,
    uint8 ServerMovementMode
)

Replicate root motion source correction to client when using root motion for movement.

Public function Virtual

void

 

ClientAdjustRootMotionSourcePosition_Implementation

(
    float TimeStamp,
    FRootMotionSourceGroup ServerRootMo...,
    bool bHasAnimRootMotion,
    float ServerMontageTrackPosition,
    FVector ServerLoc,
    FVector_NetQuantizeNormal ServerRot...,
    float ServerVelZ,
    UPrimitiveComponent* ServerBas...,
    FName ServerBoneName,
    bool bHasBase,
    bool bBaseRelativePosition,
    uint8 ServerMovementMode
)

Replicate root motion source correction to client when using root motion for movement.

Public function Virtual

void

 

ClientHandleMoveResponse

(
    const FCharacterMoveResponseDataCon...
)

On the client, handles the move response from the server after it has been received and unpacked in MoveResponsePacked_ClientReceive.

Protected function Virtual

bool

 

ClientUpdatePositionAfterServerUpdate()

If bUpdatePosition is true, then replay any unacked moves.

Public function Virtual

void

 

ClientVeryShortAdjustPosition

(
    float TimeStamp,
    FVector NewLoc,
    UPrimitiveComponent* NewBase,
    FName NewBaseBoneName,
    bool bHasBase,
    bool bBaseRelativePosition,
    uint8 ServerMovementMode
)

Bandwidth saving version, when velocity is zeroed

Public function Virtual

void

 

ClientVeryShortAdjustPosition_Implementation

(
    float TimeStamp,
    FVector NewLoc,
    UPrimitiveComponent* NewBase,
    FName NewBaseBoneName,
    bool bHasBase,
    bool bBaseRelativePosition,
    uint8 ServerMovementMode
)

Bandwidth saving version, when velocity is zeroed

Protected function Virtual Const

float

 

ComputeAnalogInputModifier()

Computes the analog input modifier based on current input vector and/or acceleration.

Public function Virtual Const

void

 

ComputeFloorDist

(
    const FVector& CapsuleLocation,
    float LineDistance,
    float SweepDistance,
    FFindFloorResult& OutFloorResult,
    float SweepRadius,
    const FHitResult* DownwardSwee...
)

Compute distance to the floor from bottom sphere of capsule and store the result in OutFloorResult.

Protected function Virtual Const

FVector

 

ComputeGroundMovementDelta

(
    const FVector& Delta,
    const FHitResult& RampHit,
    const bool bHitFromLineTrace
)

Compute a vector of movement, given a delta and a hit result of the surface we are on.

Public function Virtual Const

FRotator

 

ComputeOrientToMovementRotation

(
    const FRotator& CurrentRotation,
    float DeltaTime,
    FRotator& DeltaRotation
)

Compute a target rotation based on current movement.

Public function Virtual Const

bool

 

ComputePerchResult

(
    const float TestRadius,
    const FHitResult& InHit,
    const float InMaxFloorDist,
    FFindFloorResult& OutPerchFloorRes...
)

Compute the sweep result of the smaller capsule with radius specified by GetValidPerchRadius(), and return true if the sweep contacts a valid walkable normal within InMaxFloorDist of InHit.ImpactPoint.

Public function Virtual Const

FVector

 

ConstrainAnimRootMotionVelocity

(
    const FVector& RootMotionVelocity,
    const FVector& CurrentVelocity
)

Constrain components of root motion velocity that may not be appropriate given the current movement mode (e.g. when falling Z may be ignored).

Protected function Virtual Const

FVector

 

ConstrainInputAcceleration

(
    const FVector& InputAcceleration
)

Enforce constraints on input given current state.

Protected function Virtual

void

 

ControlledCharacterMove

(
    const FVector& InputVector,
    float DeltaSeconds
)

Updates acceleration and perform movement, called from the TickComponent on the authoritative side for controlled characters, or on the client for characters without a controller when either playing root motion or bRunPhysicsWithNoController is true.

Public function

FTransform

 

ConvertLocalRootMotionToWorld

(
    const FTransform& InLocalRootMotio...,
    float DeltaSeconds
)

Takes component space root motion and converts it to world space.

Public function

void

 

ConvertRootMotionServerIDsToLocalIDs

(
    const FRootMotionSourceGroup& Loca...,
    FRootMotionSourceGroup& InOutServe...,
    float TimeStamp
)

Converts received server IDs in a root motion group to local IDs

Public function Virtual

void

 

Crouch

(
    bool bClientSimulation
)

Checks if new capsule size fits (no encroachment), and call CharacterOwner->OnStartCrouch() if successful.

Protected function

void

 

DecayFormerBaseVelocity

(
    float deltaTime
)

Reduces former base velocity according to FormerBaseVelocityDecayHalfLife

Public function Virtual

void

 

DisableMovement()

Make movement impossible (sets movement mode to MOVE_None).

Public function Virtual

void

 

DisplayDebug

(
    UCanvas* Canvas,
    const FDebugDisplayInfo& DebugDisp...,
    float& YL,
    float& YPos
)

Draw important variables on canvas.

Public function Virtual

bool

 

DoJump

(
    bool bReplayingMoves
)

Perform jump.

Protected function Virtual

void

 

FillAsyncInput

(
    const FVector& InputVector,
    FCharacterMovementComponentAsyncInp...
)

Prepare inputs for asynchronous simulation on physics thread

Protected function Virtual Const

void

 

FindBestNavMeshLocation

(
    const FVector& TraceStart,
    const FVector& TraceEnd,
    const FVector& CurrentFeetLocation,
    const FVector& TargetNavLocation,
    FHitResult& OutHitResult
)

Performs trace for ProjectLocationFromNavMesh

Public function Virtual Const

void

 

FindFloor

(
    const FVector& CapsuleLocation,
    FFindFloorResult& OutFloorResult,
    bool bCanUseCachedLocation,
    const FHitResult* DownwardSwee...
)

Sweeps a vertical trace to find the floor for the capsule at the given location.

Public function Virtual Const

bool

 

FindNavFloor

(
    const FVector& TestLocation,
    FNavLocation& NavFloorLocation
)

Project a location to navmesh to find adjusted height.

Public function

FVector

 

FindWaterLine

(
    FVector Start,
    FVector End
)

Get as close to waterline as possible, staying on same side as currently.

Public function Virtual Const

bool

 

FloorSweepTest

(
    FHitResult& OutHit,
    const FVector& Start,
    const FVector& End,
    ECollisionChannel TraceChannel,
    const FCollisionShape& CollisionSh...,
    const FCollisionQueryParams& Param...,
    const FCollisionResponseParams& Re...
)

Sweep against the world and return the first blocking hit.

Public function Virtual

void

 

FlushServerMoves()

Public function

void

 

ForceClientAdjustment()

Force a client adjustment. Resets ServerLastClientAdjustmentTime.

Public function Virtual

void

 

ForceReplicationUpdate()

Force a client update by making it appear on the server that the client hasn't updated in a long time.

Public function Virtual

FVector

 

GetAirControl

(
    float DeltaTime,
    float TickAirControl,
    const FVector& FallAcceleration
)

Get the air control to use during falling movement.

Public function Const

float

 

GetAnalogInputModifier()

Returns modifier [0..1] based on the magnitude of the last input vector, which is used to modify the acceleration and max speed during movement.

Public function Virtual Const

FVector

 

GetBestDirectionOffActor

(
    AActor* BaseActor
)

Can be overridden to choose to jump based on character velocity, base actor dimensions, etc.

Public function Const

ACharacter &...

 

GetCharacterOwner()

Get the Character that owns UpdatedComponent.

Protected function Virtual Const

float

 

GetClientNetSendDeltaTime

(
    const APlayerController* PC,
    const FNetworkPredictionData_Client...,
    const FSavedMovePtr& NewMove
)

Determine minimum delay between sending client updates to the server.

Public function Const

float

 

GetCrouchedHalfHeight()

Returns the collision half-height when crouching (component scale is applied separately)

Public function Const

FVector

 

GetCurrentAcceleration()

Returns current acceleration, computed from input vector each update.

Protected function Const

FCharacterNe...

 

GetCurrentNetworkMoveData()

Current move data being processed or handled.

Public function Const

const FSaved...

 

GetCurrentReplayedSavedMove()

Gets the SavedMove being replayed on the client after a correction is received.

Public function Virtual Const

FRotator

 

GetDeltaRotation

(
    float DeltaTime
)

Returns how far to rotate character during the time interval DeltaTime.

Public function Virtual

FVector

 

GetFallingLateralAcceleration

(
    float DeltaTime
)

Get the lateral acceleration to use during falling movement.

Public function Const

FVector

 

GetGravityDirection()

Returns the current gravity direction.

Public function Const

FQuat

 

GetGravityToWorldTransform()

Returns a quaternion transforming from gravity to world space.

Public function Const

EMovementMod...

 

GetGroundMovementMode()

Get current GroundMovementMode value.

Public function Virtual Const

FVector

 

GetImpartedMovementBaseVelocity()

If we have a movement base, get the velocity that should be imparted by that base, usually when jumping off of it.

Public function Const

FVector

 

GetLastUpdateLocation()

Returns the location at the end of the last tick.

Public function Const

FQuat

 

GetLastUpdateQuat()

Returns the rotation Quat at the end of the last tick.

Public function Const

FVector

 

GetLastUpdateRequestedVelocity()

Returns velocity requested by path following

Public function Const

FRotator

 

GetLastUpdateRotation()

Returns the rotation at the end of the last tick.

Public function Const

FVector

 

GetLastUpdateVelocity()

Returns the velocity at the end of the last tick.

Public function Virtual Const

FVector

 

GetLedgeMove

(
    const FVector& OldLocation,
    const FVector& Delta,
    const FVector& GravDir
)

Public function Virtual Const

float

 

GetMaxAcceleration()

Returns maximum acceleration for the current state.

Public function Virtual Const

float

 

GetMaxBrakingDeceleration()

Returns maximum deceleration for the current state when braking (ie when there is no acceleration).

Public function Virtual Const

float

 

GetMaxJumpHeight()

Compute the max jump height based on the JumpZVelocity velocity and gravity.

Public function Virtual Const

float

 

GetMaxJumpHeightWithJumpTime()

Compute the max jump height based on the JumpZVelocity velocity and gravity.

Public function Virtual Const

float

 

GetMinAnalogSpeed()

Returns maximum acceleration for the current state.

Public function Const

UPrimitiveCo...

 

GetMovementBase()

Return PrimitiveComponent we are based on (standing and walking on).

Public function Virtual Const

FString

 

GetMovementName()

Returns MovementMode string

Protected function Const

FCharacterMo...

 

GetMoveResponseDataContainer()

Get the struct used for server response RPC serialization.

Protected function Const

const INavig...

 

GetNavData()

Get Navigation data for the Character. Returns null if there is no associated nav data.

Protected function Const

FCharacterNe...

 

GetNetworkMoveDataContainer()

Get the struct used for client to server move RPC serialization.

Public function Virtual Const

float

 

GetNetworkSafeRandomAngleDegrees()

Generate a random angle in degrees that is approximately equal between client and server.

Protected function Const

FCollisionSh...

 

GetPawnCapsuleCollisionShape

(
    const EShrinkCapsuleExtent ShrinkMo...,
    const float CustomShrinkAmount
)

Get the collision shape for the Pawn owner, possibly reduced in size depending on ShrinkMode.

Protected function Const

FVector

 

GetPawnCapsuleExtent

(
    const EShrinkCapsuleExtent ShrinkMo...,
    const float CustomShrinkAmount
)

Get the capsule extent for the Pawn owner, possibly reduced in size depending on ShrinkMode.

Public function Const

float

 

GetPerchRadiusThreshold()

Returns The distance from the edge of the capsule within which we don't allow the character to perch on the edge of a surface.

Public function Const

FNetworkPred...

 

GetPredictionData_Client_Character()

Public function Const

FNetworkPred...

 

GetPredictionData_Server_Character()

Public function

TSharedPtr< ...

 

GetRootMotionSource

(
    FName InstanceName
)

Get a RootMotionSource from current root motion by name

Public function

TSharedPtr< ...

 

GetRootMotionSourceByID

(
    uint16 RootMotionSourceID
)

Get a RootMotionSource from current root motion by ID

Public function Const

int32

 

GetRVOAvoidanceUIDFast()

END IRVOAvoidanceInterface a shortcut function to be called instead of GetRVOAvoidanceUID when callee knows it's dealing with a char movement comp

Public function Const

float

 

GetServerLastTransformUpdateTimeStamp()

Get the value of ServerLastTransformUpdateTimeStamp.

Public function Const

float

 

GetSimulationTimeStep

(
    float RemainingTime,
    int32 Iterations
)

Compute remaining time step given remaining time and current iterations.

Public function Const

ETeleportTyp...

 

GetTeleportType()

When moving the character, we should inform physics as to whether we are teleporting.

Public function Const

float

 

GetValidPerchRadius()

Returns the radius within which we can stand on the edge of a surface without falling (if this is a walkable surface).

Public function Const

float

 

GetWalkableFloorAngle()

Get the max angle in degrees of a walkable surface for the character.

Public function Const

float

 

GetWalkableFloorZ()

Get the Z component of the normal of the steepest walkable surface for the character.

Public function Const

FQuat

 

GetWorldToGravityTransform()

Returns a quaternion transforming from world to gravity space.

Public function Virtual

bool

 

HandlePendingLaunch()

Handle a pending launch during an update. Returns true if the launch was triggered.

Protected function Virtual Const

FVector

 

HandleSlopeBoosting

(
    const FVector& SlideResult,
    const FVector& Delta,
    const float Time,
    const FVector& Normal,
    const FHitResult& Hit
)

Limit the slide vector when falling if the resulting slide might boost the character faster upwards.

Protected function Virtual

void

 

HandleSwimmingWallHit

(
    const FHitResult& Hit,
    float DeltaTime
)

Allow custom handling when character hits a wall while swimming.

Public function Virtual

void

 

HandleWalkingOffLedge

(
    const FVector& PreviousFloorImpact...,
    const FVector& PreviousFloorContac...,
    const FVector& PreviousLocation,
    float TimeDelta
)

Trigger OnWalkingOffLedge event on CharacterOwner.

Public function Const

bool

 

HasAnimRootMotion()

Returns true if we have Root Motion from animation to use in PerformMovement() physics.

Public function Const

bool

 

HasCustomGravity()

Whether the gravity direction is different from UCharacterMovementComponent::DefaultGravityDirection.

Public function Const

bool

 

HasRootMotionSources()

Returns true if we have Root Motion from any source to use in PerformMovement() physics.

Public function Virtual Const

bool

 

HasValidData()

Return true if we have a valid CharacterOwner and UpdatedComponent.

Public function Virtual Const

float

 

ImmersionDepth()

Determine how deep in water the character is immersed.

Protected function Virtual Const

bool

 

IsAsyncCallbackRegistered()

Protected function Const

bool

 

IsClientTimeStampValid

(
    float TimeStamp,
    const FNetworkPredictionData_Server...,
    bool& bTimeStampResetDetected
)

Internal const check for client timestamp validity without side-effects.

Public function Const

bool

 

IsMovementInProgress()

Returns true if currently performing a movement update.

Public function Virtual Const

bool

 

IsValidLandingSpot

(
    const FVector& CapsuleLocation,
    const FHitResult& Hit
)

Verify that the supplied hit result is a valid landing spot when falling.

Public function Virtual Const

bool

 

IsWalkable

(
    const FHitResult& Hit
)

Return true if the hit result should be considered a walkable surface for the character.

Public function Const

bool

 

IsWalking()

Returns true if the character is in the 'Walking' movement mode.

Public function Virtual Const

bool

 

IsWithinEdgeTolerance

(
    const FVector& CapsuleLocation,
    const FVector& TestImpactPoint,
    const float CapsuleRadius
)

Return true if the 2D distance to the impact point is inside the edge tolerance (CapsuleRadius minus a small rejection threshold).

Public function Virtual

void

 

JumpOff

(
    AActor* MovementBaseActor
)

Force this pawn to bounce off its current base, which isn't an acceptable base for it.

Public function Virtual

void

 

JumpOutOfWater

(
    FVector WallNormal
)

Jump onto shore from water

Public function Virtual Const

void

 

K2_ComputeFloorDist

(
    FVector CapsuleLocation,
    float LineDistance,
    float SweepDistance,
    float SweepRadius,
    FFindFloorResult& FloorResult
)

Compute distance to the floor from bottom sphere of capsule and store the result in FloorResult.

Public function Virtual Const

void

 

K2_FindFloor

(
    FVector CapsuleLocation,
    FFindFloorResult& FloorResult
)

Sweeps a vertical trace to find the floor for the capsule at the given location.

Public function Const

float

 

K2_GetWalkableFloorAngle()

Get the max angle in degrees of a walkable surface for the character.

Public function Const

float

 

K2_GetWalkableFloorZ()

Get the Z component of the normal of the steepest walkable surface for the character.

Public function Virtual

void

 

Launch

(
    FVector const& LaunchVel
)

Queue a pending launch with velocity LaunchVel.

Protected function Virtual

FVector

 

LimitAirControl

(
    float DeltaTime,
    const FVector& FallAcceleration,
    const FHitResult& HitResult,
    bool bCheckForValidLandingSpot
)

Limits the air control to use during falling movement, given an impact while falling.

Protected function Virtual

void

 

MaintainHorizontalGroundVelocity()

Adjusts velocity when walking so that Z velocity is zero.

Public function Virtual

void

 

MaybeSaveBaseLocation()

Call SaveBaseLocation() if not deferring updates (bDeferUpdateBasedMovement is false).

Public function Virtual

void

 

MaybeUpdateBasedMovement

(
    float DeltaSeconds
)

Update or defer updating of position based on Base movement

Protected function Virtual

void

 

MoveAlongFloor

(
    const FVector& InVelocity,
    float DeltaSeconds,
    FStepDownResult* OutStepDownRe...
)

Move along the floor, using CurrentFloor and ComputeGroundMovementDelta() to get a movement direction.

Protected function Virtual

void

 

MoveAutonomous

(
    float ClientTimeStamp,
    float DeltaTime,
    uint8 CompressedFlags,
    const FVector& NewAccel
)

Process a move at the given time stamp, given the compressed flags representing various events that occurred (ie jump).

Public function

void

 

MoveResponsePacked_ClientReceive

(
    const FCharacterMoveResponsePackedB...
)

On the client, receives a packed move response from the server, unpacks it by serializing into the MoveResponseContainer from GetMoveResponseDataContainer(), and passes the data container to ClientHandleMoveResponse().

Public function

void

 

MoveResponsePacked_ServerSend

(
    const FCharacterMoveResponsePackedB...
)

Sends a move response from the server to the client (through character to avoid component RPC overhead), eventually calling MoveResponsePacked_ClientReceive() on the client.

Public function Virtual

void

 

MoveSmooth

(
    const FVector& InVelocity,
    const float DeltaSeconds,
    FStepDownResult* OutStepDownRe...
)

Moves along the given movement direction using simple movement rules based on the current movement mode (usually used by simulated proxies).

Public function Virtual Const

FVector

 

NewFallVelocity

(
    const FVector& InitialVelocity,
    const FVector& Gravity,
    float DeltaTime
)

Compute new falling velocity from given velocity and gravity.

Public function Virtual

void

 

NotifyJumpApex()

Called if bNotifyApex is true and character has just passed the apex of its jump.

Protected function Virtual

void

 

OnCharacterStuckInGeometry

(
    const FHitResult* Hit
)

Notification that the character is stuck in geometry. Only called during walking movement.

Protected function Virtual

void

 

OnClientCorrectionReceived

(
    FNetworkPredictionData_Client_Chara...,
    float TimeStamp,
    FVector NewLocation,
    FVector NewVelocity,
    UPrimitiveComponent* NewBase,
    FName NewBaseBoneName,
    bool bHasBase,
    bool bBaseRelativePosition,
    uint8 ServerMovementMode,
    FVector ServerGravityDirection
)

END DEPRECATED movement RPCs.

Protected function Virtual

void

 

OnClientTimeStampResetDetected()

Called by UCharacterMovementComponent::VerifyClientTimeStamp() when a client timestamp reset has been detected and is valid.

Protected function Virtual

void

 

OnMovementModeChanged

(
    EMovementMode PreviousMovementMode,
    uint8 PreviousCustomMode
)

Called after MovementMode has changed.

Protected function Virtual

void

 

OnMovementUpdated

(
    float DeltaSeconds,
    const FVector& OldLocation,
    const FVector& OldVelocity
)

Event triggered at the end of a movement update.

Public function Virtual

void

 

OnRootMotionSourceBeingApplied

(
    const FRootMotionSource* Sourc...
)

Called during ApplyRootMotionSource call, useful for project-specific alerts for "something is about to be altering our movement"

Protected function Virtual

void

 

OnTimeDiscrepancyDetected

(
    float CurrentTimeDiscrepancy,
    float LifetimeRawTimeDiscrepancy,
    float Lifetime,
    float CurrentMoveError
)

Called by UCharacterMovementComponent::ProcessClientTimeStampForTimeDiscrepancy() (on server) when the time from client moves significantly differs from the server time, indicating potential time manipulation by clients (speed hacks, significant network issues, client performance problems)

Protected function Virtual

void

 

OnUnableToFollowBaseMove

(
    const FVector& DeltaPosition,
    const FVector& OldLocation,
    const FHitResult& MoveOnBaseHit
)

Event triggered when we are moving on a base but we are not able to move the full DeltaPosition because something has blocked us.

Public function Virtual Const

uint8

 

PackNetworkMovementMode()

Public function Static

uint32

 

PackYawAndPitchTo32

(
    const float Yaw,
    const float Pitch
)

Public function Virtual

void

 

PerformAirControlForPathFollowing

(
    FVector Direction,
    float ZDiff
)

If ShouldPerformAirControlForPathFollowing() returns true, it will update Velocity and Acceleration to air control in the desired Direction for character using path following.

Protected function Virtual

void

 

PerformMovement

(
    float DeltaTime
)

Movement functions broken out based on owner's network Role.

Protected function Virtual

void

 

PhysCustom

(
    float deltaTime,
    int32 Iterations
)

Movement update functions should only be called through StartNewPhysics()

Public function Virtual

void

 

PhysFalling

(
    float deltaTime,
    int32 Iterations
)

Handle falling movement.

Protected function Virtual

void

 

PhysFlying

(
    float deltaTime,
    int32 Iterations
)

Movement update functions should only be called through StartNewPhysics()

Public function Virtual

void

 

PhysicsRotation

(
    float DeltaTime
)

Perform rotation over deltaTime

Protected function Virtual

void

 

PhysNavWalking

(
    float deltaTime,
    int32 Iterations
)

Movement update functions should only be called through StartNewPhysics()

Protected function Virtual

void

 

PhysSwimming

(
    float deltaTime,
    int32 Iterations
)

Movement update functions should only be called through StartNewPhysics()

Protected function Virtual

void

 

PhysWalking

(
    float deltaTime,
    int32 Iterations
)

Movement update functions should only be called through StartNewPhysics()

Protected function Virtual

void

 

PostBuildAsyncInput()

Public function Virtual

void

 

PostPhysicsTickComponent

(
    float DeltaTime,
    FCharacterMovementComponentPostPhys...
)

Tick function called after physics (sync scene) has finished simulation, before cloth

Public function Virtual

void

 

PostProcessAvoidanceVelocity

(
    FVector& NewVelocity
)

Allows modifing avoidance velocity, called when bUseRVOPostProcess is set

Public function Virtual

void

 

PrePhysicsTickComponent

(
    float DeltaTime,
    FCharacterMovementComponentPrePhysi...
)

Tick function called before physics

Protected function Virtual

void

 

ProcessAsyncOutput()

Protected function Virtual

void

 

ProcessClientTimeStampForTimeDiscrepancy

(
    float ClientTimeStamp,
    FNetworkPredictionData_Server_Chara...
)

Processes client timestamps from ServerMoves, detects and protects against time discrepancy between client-reported times and server time Called by UCharacterMovementComponent::VerifyClientTimeStamp() for valid timestamps.

Protected function Virtual

void

 

ProcessLanded

(
    const FHitResult& Hit,
    float remainingTime,
    int32 Iterations
)

Handle landing against Hit surface over remaingTime and iterations, calling SetPostLandedPhysics() and starting the new movement mode.

Protected function Virtual

FVector

 

ProjectLocationFromNavMesh

(
    float DeltaSeconds,
    const FVector& CurrentFeetLocation,
    const FVector& TargetNavLocation,
    float UpOffset,
    float DownOffset
)

Attempts to better align navmesh walking characters with underlying geometry (sometimes navmesh can differ quite significantly from geometry).

Protected function Virtual

void

 

RegisterAsyncCallback()

Register async callback with physics system.

Public function

void

 

RemoveRootMotionSource

(
    FName InstanceName
)

Remove a RootMotionSource from current root motion by name

Public function

void

 

RemoveRootMotionSourceByID

(
    uint16 RootMotionSourceID
)

Remove a RootMotionSource from current root motion by ID

Protected function Virtual

void

 

ReplicateMoveToServer

(
    float DeltaTime,
    const FVector& NewAcceleration
)

======================================================================== Here's how player movement prediction, replication and correction works in network games:

Protected function

void

 

RestorePreAdditiveRootMotionVelocity()

Restores Velocity to LastPreAdditiveVelocity during Root Motion Phys*() function calls

Public function

void

 

RevertMove

(
    const FVector& OldLocation,
    UPrimitiveComponent* OldBase,
    const FVector& InOldBaseLocation,
    const FFindFloorResult& OldFloor,
    bool bFailMove
)

Revert to previous position OldLocation, return to being based on OldBase.

Public function Const

FVector

 

RotateGravityToWorld

(
    const FVector& World
)

Rotate a vector from world to gravity space.

Public function Const

FVector

 

RotateWorldToGravity

(
    const FVector& Gravity
)

Rotate a vector gravity to world space.

Public function Virtual Const

FVector

 

RoundAcceleration

(
    FVector InAccel
)

Round acceleration, for better consistency and lower bandwidth in networked games.

Public function Virtual

void

 

SaveBaseLocation()

Update OldBaseLocation and OldBaseQuat if there is a valid movement base, and store the relative location/rotation if necessary.

Protected function Virtual Const

FVector

 

ScaleInputAcceleration

(
    const FVector& InputAcceleration
)

Scale input acceleration, based on movement acceleration rate.

Protected function Virtual

void

 

ServerAutonomousProxyTick

(
    float DeltaSeconds
)

Special Tick to allow custom server-side functionality on Autonomous Proxies.

Protected function Virtual

bool

 

ServerCheckClientError

(
    float ClientTimeStamp,
    float DeltaTime,
    const FVector& Accel,
    const FVector& ClientWorldLocation,
    const FVector& RelativeClientLocat...,
    UPrimitiveComponent* ClientMov...,
    FName ClientBaseBoneName,
    uint8 ClientMovementMode
)

Check for Server-Client disagreement in position or other movement state important enough to trigger a client correction.

Protected function Virtual

bool

 

ServerExceedsAllowablePositionError

(
    float ClientTimeStamp,
    float DeltaTime,
    const FVector& Accel,
    const FVector& ClientWorldLocation,
    const FVector& RelativeClientLocat...,
    UPrimitiveComponent* ClientMov...,
    FName ClientBaseBoneName,
    uint8 ClientMovementMode
)

Check position error within ServerCheckClientError().

Public function Virtual

void

 

ServerMove

(
    float TimeStamp,
    FVector_NetQuantize10 InAccel,
    FVector_NetQuantize100 ClientLoc,
    uint8 CompressedMoveFlags,
    uint8 ClientRoll,
    uint32 View,
    UPrimitiveComponent* ClientMov...,
    FName ClientBaseBoneName,
    uint8 ClientMovementMode
)

BEGIN DEPRECATED movement RPCs. Use the Packed versions above instead.

Public function Virtual

void

 

ServerMove_HandleMoveData

(
    const FCharacterNetworkMoveDataCont...
)

Handle movement data after it's unpacked from the ServerMovePacked_ServerReceive() call.

Public function Virtual

void

 

ServerMove_Implementation

(
    float TimeStamp,
    FVector_NetQuantize10 InAccel,
    FVector_NetQuantize100 ClientLoc,
    uint8 CompressedMoveFlags,
    uint8 ClientRoll,
    uint32 View,
    UPrimitiveComponent* ClientMov...,
    FName ClientBaseBoneName,
    uint8 ClientMovementMode
)

BEGIN DEPRECATED movement RPCs. Use the Packed versions above instead.

Public function Virtual

void

 

ServerMove_PerformMovement

(
    const FCharacterNetworkMoveData& M...
)

Check timestamps, generate a delta time, and pass through movement params to MoveAutonomous.

Public function Virtual

bool

 

ServerMove_Validate

(
    float TimeStamp,
    FVector_NetQuantize10 InAccel,
    FVector_NetQuantize100 ClientLoc,
    uint8 CompressedMoveFlags,
    uint8 ClientRoll,
    uint32 View,
    UPrimitiveComponent* ClientMov...,
    FName ClientBaseBoneName,
    uint8 ClientMovementMode
)

BEGIN DEPRECATED movement RPCs. Use the Packed versions above instead.

Public function Virtual

void

 

ServerMoveDual

(
    float TimeStamp0,
    FVector_NetQuantize10 InAccel0,
    uint8 PendingFlags,
    uint32 View0,
    float TimeStamp,
    FVector_NetQuantize10 InAccel,
    FVector_NetQuantize100 ClientLoc,
    uint8 NewFlags,
    uint8 ClientRoll,
    uint32 View,
    UPrimitiveComponent* ClientMov...,
    FName ClientBaseBoneName,
    uint8 ClientMovementMode
)

Replicated function sent by client to server - contains client movement and view info for two moves.

Public function Virtual

void

 

ServerMoveDual_Implementation

(
    float TimeStamp0,
    FVector_NetQuantize10 InAccel0,
    uint8 PendingFlags,
    uint32 View0,
    float TimeStamp,
    FVector_NetQuantize10 InAccel,
    FVector_NetQuantize100 ClientLoc,
    uint8 NewFlags,
    uint8 ClientRoll,
    uint32 View,
    UPrimitiveComponent* ClientMov...,
    FName ClientBaseBoneName,
    uint8 ClientMovementMode
)

Replicated function sent by client to server - contains client movement and view info for two moves.

Public function Virtual

bool

 

ServerMoveDual_Validate

(
    float TimeStamp0,
    FVector_NetQuantize10 InAccel0,
    uint8 PendingFlags,
    uint32 View0,
    float TimeStamp,
    FVector_NetQuantize10 InAccel,
    FVector_NetQuantize100 ClientLoc,
    uint8 NewFlags,
    uint8 ClientRoll,
    uint32 View,
    UPrimitiveComponent* ClientMov...,
    FName ClientBaseBoneName,
    uint8 ClientMovementMode
)

Replicated function sent by client to server - contains client movement and view info for two moves.

Public function Virtual

void

 

ServerMoveDualHybridRootMotion

(
    float TimeStamp0,
    FVector_NetQuantize10 InAccel0,
    uint8 PendingFlags,
    uint32 View0,
    float TimeStamp,
    FVector_NetQuantize10 InAccel,
    FVector_NetQuantize100 ClientLoc,
    uint8 NewFlags,
    uint8 ClientRoll,
    uint32 View,
    UPrimitiveComponent* ClientMov...,
    FName ClientBaseBoneName,
    uint8 ClientMovementMode
)

Replicated function sent by client to server - contains client movement and view info for two moves.

Public function Virtual

void

 

ServerMoveDualHybridRootMotion_Implementation

(
    float TimeStamp0,
    FVector_NetQuantize10 InAccel0,
    uint8 PendingFlags,
    uint32 View0,
    float TimeStamp,
    FVector_NetQuantize10 InAccel,
    FVector_NetQuantize100 ClientLoc,
    uint8 NewFlags,
    uint8 ClientRoll,
    uint32 View,
    UPrimitiveComponent* ClientMov...,
    FName ClientBaseBoneName,
    uint8 ClientMovementMode
)

Replicated function sent by client to server - contains client movement and view info for two moves.

Public function Virtual

bool

 

ServerMoveDualHybridRootMotion_Validate

(
    float TimeStamp0,
    FVector_NetQuantize10 InAccel0,
    uint8 PendingFlags,
    uint32 View0,
    float TimeStamp,
    FVector_NetQuantize10 InAccel,
    FVector_NetQuantize100 ClientLoc,
    uint8 NewFlags,
    uint8 ClientRoll,
    uint32 View,
    UPrimitiveComponent* ClientMov...,
    FName ClientBaseBoneName,
    uint8 ClientMovementMode
)

Replicated function sent by client to server - contains client movement and view info for two moves.

Protected function Virtual

void

 

ServerMoveHandleClientError

(
    float ClientTimeStamp,
    float DeltaTime,
    const FVector& Accel,
    const FVector& RelativeClientLocat...,
    UPrimitiveComponent* ClientMov...,
    FName ClientBaseBoneName,
    uint8 ClientMovementMode
)

Have the server check if the client is outside an error tolerance, and queue a client adjustment if so.

Public function Virtual

void

 

ServerMoveOld

(
    float OldTimeStamp,
    FVector_NetQuantize10 OldAccel,
    uint8 OldMoveFlags
)

Resending an (important) old move. Process it if not already processed.

Public function Virtual

void

 

ServerMoveOld_Implementation

(
    float OldTimeStamp,
    FVector_NetQuantize10 OldAccel,
    uint8 OldMoveFlags
)

Resending an (important) old move. Process it if not already processed.

Public function Virtual

bool

 

ServerMoveOld_Validate

(
    float OldTimeStamp,
    FVector_NetQuantize10 OldAccel,
    uint8 OldMoveFlags
)

Resending an (important) old move. Process it if not already processed.

Public function

void

 

ServerMovePacked_ClientSend

(
    const FCharacterServerMovePackedBit...
)

The actual network RPCs for character movement are passed to ACharacter, which wrap to the _Implementation call here, to avoid Component RPC overhead.

Public function

void

 

ServerMovePacked_ServerReceive

(
    const FCharacterServerMovePackedBit...
)

On the server, receives packed move data from the Character RPC, unpacks them into the FCharacterNetworkMoveDataContainer returned from GetNetworkMoveDataContainer(), and passes the data container to ServerMove_HandleMoveData().

Public function

void

 

ServerSendMoveResponse

(
    const FClientAdjustment& PendingAd...
)

On the server, sends a packed move response to the client.

Protected function Virtual

bool

 

ServerShouldUseAuthoritativePosition

(
    float ClientTimeStamp,
    float DeltaTime,
    const FVector& Accel,
    const FVector& ClientWorldLocation,
    const FVector& RelativeClientLocat...,
    UPrimitiveComponent* ClientMov...,
    FName ClientBaseBoneName,
    uint8 ClientMovementMode
)

If ServerCheckClientError() does not find an error, this determines if the server should also copy the client's movement params rather than keep the server sim result.

Public function

void

 

SetAvoidanceEnabled

(
    bool bEnable
)

Change avoidance state and registers in RVO manager if needed

Public function

void

 

SetAvoidanceGroup

(
    int32 GroupFlags
)

Public function

void

 

SetAvoidanceGroupMask

(
    const FNavAvoidanceMask& GroupMask
)

Public function

void

 

SetAvoidanceVelocityLock

(
    UAvoidanceManager* Avoidance,
    float Duration
)

Lock avoidance velocity

Public function Virtual

void

 

SetBase

(
    UPrimitiveComponent* NewBase,
    const FName BoneName,
    bool bNotifyActor
)

Update the base of the character, which is the PrimitiveComponent we are standing on.

Public function

void

 

SetBaseFromFloor

(
    const FFindFloorResult& FloorResul...
)

Update the base of the character, using the given floor result if it is walkable, or null if not.

Public function

void

 

SetCrouchedHalfHeight

(
    const float NewValue
)

Sets collision half-height when crouching and updates dependent computations

Protected function

void

 

SetCurrentNetworkMoveData

(
    FCharacterNetworkMoveData* Cur...
)

Used internally to set the FCharacterNetworkMoveData currently being processed, either being serialized or replayed on the client, or being received and processed on the server.

Protected function

void

 

SetCurrentReplayedSavedMove

(
    FSavedMove_Character* SavedMov...
)

Used internally to save the SavedMove currently being replayed on the client so it is accessible to any functions that might need it.

Public function Virtual

void

 

SetDefaultMovementMode()

Set movement mode to the default based on the current physics volume.

Public function Virtual

void

 

SetGravityDirection

(
    const FVector& GravityDir
)

Set a custom, local gravity direction to use during movement simulation.

Public function

void

 

SetGroundMovementMode

(
    EMovementMode NewGroundMovementMode
)

Set movement mode to use when returning to walking movement (either MOVE_Walking or MOVE_NavWalking).

Public function

void

 

SetGroupsToAvoid

(
    int32 GroupFlags
)

Public function

void

 

SetGroupsToAvoidMask

(
    const FNavAvoidanceMask& GroupMask
)

Public function

void

 

SetGroupsToIgnore

(
    int32 GroupFlags
)

Public function

void

 

SetGroupsToIgnoreMask

(
    const FNavAvoidanceMask& GroupMask
)

Public function Virtual

void

 

SetMovementMode

(
    EMovementMode NewMovementMode,
    uint8 NewCustomMode
)

Change movement mode.

Protected function

void

 

SetMoveResponseDataContainer

Set custom struct used for server response RPC serialization.

Protected function Virtual

void

 

SetNavWalkingPhysics

(
    bool bEnable
)

Switch collision settings for NavWalking mode (ignore world collisions)

Protected function

void

 

SetNetworkMoveDataContainer

Set custom struct used for client to server move RPC serialization.

Protected function Virtual

void

 

SetPostLandedPhysics

(
    const FHitResult& Hit
)

Use new physics after landing. Defaults to swimming if in water, walking otherwise.

Public function

void

 

SetWalkableFloorAngle

(
    float InWalkableFloorAngle
)

Set the max angle in degrees of a walkable surface for the character. Also computes WalkableFloorZ.

Public function

void

 

SetWalkableFloorZ

(
    float InWalkableFloorZ
)

Set the Z component of the normal of the steepest walkable surface for the character.

Protected function Virtual Const

bool

 

ShouldCancelAdaptiveReplication()

On the server if we know we are having our replication rate throttled, this method checks if important replicated properties have changed that should cause us to return to the normal replication rate.

Public function Virtual

bool

 

ShouldCatchAir

(
    const FFindFloorResult& OldFloor,
    const FFindFloorResult& NewFloor
)

Whether Character should go into falling mode when walking and changing position, based on an old and new floor result (both of which are considered walkable).

Public function Virtual Const

bool

 

ShouldCheckForValidLandingSpot

(
    float DeltaTime,
    const FVector& Delta,
    const FHitResult& Hit
)

Determine whether we should try to find a valid landing spot after an impact with an invalid one (based on the Hit result).

Protected function Virtual Const

bool

 

ShouldComputeAccelerationToReachRequestedVelocity

(
    const float RequestedSpeed
)

When a character requests a velocity (like when following a path), this method returns true if when we should compute the acceleration toward requested velocity (including friction).

Public function Virtual Const

bool

 

ShouldComputePerchResult

(
    const FHitResult& InHit,
    bool bCheckRadius
)

Check if the result of a sweep test (passed in InHit) might be a valid location to perch, in which case we should use ComputePerchResult to validate the location.

Public function Virtual Const

bool

 

ShouldCorrectRotation()

Returns if the character rotation should be corrected on clients when sending a server move response correction.

Public function Virtual

bool

 

ShouldJumpOutOfWater

(
    FVector& JumpDir
)

Determine whether the Character should jump when exiting water.

Public function Virtual Const

bool

 

ShouldLimitAirControl

(
    float DeltaTime,
    const FVector& FallAcceleration
)

Returns true if falling movement should limit air control.

Public function Virtual Const

bool

 

ShouldPerformAirControlForPathFollowing()

Whether Character should perform air control via PerformAirControlForPathFollowing when falling and following a path at the same time Default implementation always returns true during MOVE_Falling.

Public function Virtual Const

bool

 

ShouldRemainVertical()

If true, DesiredRotation will be restricted to only Yaw component in PhysicsRotation()

Public function Virtual Const

bool

 

ShouldUsePackedMovementRPCs()

Determines whether to use packed movement RPCs with variable length payloads, or legacy code which has multiple functions required for different situations.

Protected function Virtual

void

 

SimulatedTick

(
    float DeltaSeconds
)

Special Tick for Simulated Proxies

Protected function Virtual

void

 

SimulateMovement

(
    float DeltaTime
)

Simulate movement on a non-owning client.

Public function

void

 

SimulateRootMotion

(
    float DeltaSeconds,
    const FTransform& LocalRootMotionT...
)

Simulate Root Motion physics on Simulated Proxies

Protected function Virtual

void

 

SmoothClientPosition

(
    float DeltaSeconds
)

Smooth mesh location for network interpolation, based on values set up by SmoothCorrection.

Protected function

void

 

SmoothClientPosition_Interpolate

(
    float DeltaSeconds
)

Update interpolation values for client smoothing.

Protected function

void

 

SmoothClientPosition_UpdateVisuals()

Update mesh location based on interpolated values.

Public function Virtual

void

 

StartFalling

(
    int32 Iterations,
    float remainingTime,
    float timeTick,
    const FVector& Delta,
    const FVector& subLoc
)

Transition from walking to falling

Public function Virtual

void

 

StartNewPhysics

(
    float deltaTime,
    int32 Iterations
)

Changes physics based on MovementMode

Public function Virtual

void

 

StartSwimming

(
    FVector OldLocation,
    FVector OldVelocity,
    float timeTick,
    float remainingTime,
    int32 Iterations
)

Handle start swimming functionality

Public function Virtual

bool

 

StepUp

(
    const FVector& GravDir,
    const FVector& Delta,
    const FHitResult& Hit,
    FStepDownResult* OutStepDownRe...
)

Move up steps or slope. Does nothing and returns false if CanStepUp(Hit) returns false.

Public function

float

 

Swim

(
    FVector Delta,
    FHitResult& Hit
)

Swimming uses gravity - but scaled by (1.f - buoyancy)

Protected function Virtual

void

 

TickCharacterPose

(
    float DeltaTime
)

Ticks the characters pose and accumulates root motion

Protected function Virtual

bool

 

TryToLeaveNavWalking()

Checks to see if the current location is not encroaching blocking geometry so the character can leave NavWalking.

Public function Virtual

void

 

UnCrouch

(
    bool bClientSimulation
)

Checks if default capsule size fits (no encroachment), and trigger OnEndCrouch() on the owner if successful.

Public function Virtual Const

void

 

UnpackNetworkMovementMode

(
    const uint8 ReceivedMode,
    TEnumAsByte< EMovementMode >& OutM...,
    uint8& OutCustomMode,
    TEnumAsByte< EMovementMode >& OutG...
)

Public function Virtual

void

 

UpdateBasedMovement

(
    float DeltaSeconds
)

Update position based on Base movement

Public function Virtual

void

 

UpdateBasedRotation

(
    FRotator& FinalRotation,
    const FRotator& ReducedRotation
)

Update controller's view rotation as pawn's base rotates

Public function Virtual

void

 

UpdateCharacterStateAfterMovement

(
    float DeltaSeconds
)

Update the character state in PerformMovement after the position change.

Public function Virtual

void

 

UpdateCharacterStateBeforeMovement

(
    float DeltaSeconds
)

Update the character state in PerformMovement right before doing the actual position change

Protected function

void

 

UpdateDefaultAvoidance()

Called in Tick to update data in RVO avoidance manager

Public function Virtual

void

 

UpdateFloorFromAdjustment()

React to instantaneous change in position.

Protected function Virtual

void

 

UpdateFromCompressedFlags

(
    uint8 Flags
)

Unpack compressed flags from a saved move and set state accordingly.

Public function Virtual

void

 

UpdateProxyAcceleration()

Used during SimulateMovement for proxies, this computes a new value for Acceleration before running proxy simulation.

Public function Virtual

bool

 

VerifyClientTimeStamp

(
    float TimeStamp,
    FNetworkPredictionData_Server_Chara...
)

On the Server, verify that an incoming client TimeStamp is valid and has not yet expired.

Public function Virtual Const

float

 

VisualizeMovement()

Draw in-world debug information for character movement (called with p.VisualizeMovement > 0).

Overridden from UPawnMovementComponent

Name Description

Public function Virtual

void

 

NotifyBumpedPawn

(
    APawn* BumpedPawn
)

Notify of collision in case we want to react, such as waking up avoidance or pathing code.

Overridden from UNavMovementComponent

Name Description

Public function Virtual Const

bool

 

CanStartPathFollowing()

Returns true if path following can start

Public function Virtual Const

bool

 

CanStopPathFollowing()

Check if current move target can be reached right now if positions are matching (e.g. performing scripted move and can't stop)

Public function Virtual Const

float

 

GetPathFollowingBrakingDistance

(
    float MaxSpeed
)

Returns braking distance for acceleration driven path following

Public function Virtual Const

bool

 

IsCrouching()

Returns true if currently crouching

Public function Virtual Const

bool

 

IsFalling()

Returns true if currently falling (not flying, in a non-fluid volume, and not on the ground)

Public function Virtual Const

bool

 

IsFlying()

Returns true if currently flying (moving through a non-fluid volume without resting on the ground)

Public function Virtual Const

bool

 

IsMovingOnGround()

Returns true if currently moving on the ground (e.g. walking or driving)

Public function Virtual Const

bool

 

IsSwimming()

Returns true if currently swimming (moving through a fluid volume)

Public function Virtual

void

 

RequestDirectMove

(
    const FVector& MoveVelocity,
    bool bForceMaxSpeed
)

Path following: request new velocity

Public function Virtual

void

 

RequestPathMove

(
    const FVector& MoveInput
)

UNavMovementComponent override for input operations.

Public function Virtual

void

 

StopActiveMovement()

Stops applying further movement (usually zeros acceleration).

Overridden from UMovementComponent

Name Description

Public function Virtual

void

 

AddRadialForce

(
    const FVector& Origin,
    float Radius,
    float Strength,
    enum ERadialImpulseFalloff Falloff
)

Adds force from radial force components.

Public function Virtual

void

 

AddRadialImpulse

(
    const FVector& Origin,
    float Radius,
    float Strength,
    enum ERadialImpulseFalloff Falloff,
    bool bVelChange
)

Adds impulse from radial force components.

Protected function Virtual Const

FVector

 

ComputeSlideVector

(
    const FVector& Delta,
    const float Time,
    const FVector& Normal,
    const FHitResult& Hit
)

Calculate slide vector along a surface.

Public function Virtual Const

float

 

GetGravityZ()

Returns gravity that affects this component

Public function Virtual Const

float

 

GetMaxSpeed()

Returns maximum speed of component in current movement mode.

Protected function Virtual Const

FVector

 

GetPenetrationAdjustment

(
    const FHitResult& Hit
)

Overridden to enforce max distances based on hit geometry.

Protected function Virtual

void

 

HandleImpact

(
    const FHitResult& Hit,
    float TimeSlice,
    const FVector& MoveDelta
)

Handle a blocking impact.

Public function Virtual

void

 

OnTeleported()

Called by owning Character upon successful teleport from AActor::TeleportTo().

Public function Virtual

void

 

PhysicsVolumeChanged

(
    APhysicsVolume* NewVolume
)

Delegate when PhysicsVolume of UpdatedComponent has been changed

Protected function Virtual

bool

 

ResolvePenetrationImpl

(
    const FVector& Adjustment,
    const FHitResult& Hit,
    const FQuat& NewRotation
)

Overridden to set bJustTeleported to true, so we don't make incorrect velocity calculations based on adjusted movement.

Public function Virtual

void

 

SetUpdatedComponent

(
    USceneComponent* NewUpdatedCom...
)

Overridden to only allow registration with components owned by a Pawn.

Protected function Virtual

float

 

SlideAlongSurface

(
    const FVector& Delta,
    float Time,
    const FVector& Normal,
    FHitResult& Hit,
    bool bHandleImpact
)

Custom version of SlideAlongSurface that handles different movement modes separately; namely during walking physics we might not want to slide up slopes.

Protected function Virtual Const

void

 

TwoWallAdjust

(
    FVector& WorldSpaceDelta,
    const FHitResult& Hit,
    const FVector& OldHitNormal
)

Custom version that allows upwards slides when walking if the surface is walkable.

Overridden from UActorComponent

Name Description

Public function Virtual

void

 

ApplyWorldOffset

(
    const FVector& InOffset,
    bool bWorldShift
)

Called by owner actor on position shifting Component should update all relevant data structures to reflect new actor location

Public function Virtual

void

 

BeginPlay()

Begins Play for the component.

Public function Virtual

void

 

Deactivate()

Deactivates the SceneComponent.

Public function Virtual

void

 

OnRegister()

Overridden to update component properties that should be updated while being edited.

Public function Virtual

void

 

RegisterComponentTickFunctions

(
    bool bRegister
)

Virtual call chain to register all tick functions

Public function Virtual

void

 

TickComponent

(
    float DeltaTime,
    enum ELevelTick TickType,
    FActorComponentTickFunction* T...
)

Function called every frame on this ActorComponent.

Overridden from UObject

Name Description

Public function Virtual

void

 

BeginDestroy()

Called before destroying the object.

Public function Virtual

void

 

PostEditChangeProperty

(
    FPropertyChangedEvent& PropertyCha...
)

Called when a property on this object has been modified externally

Public function Virtual

void

 

PostLoad()

Do any object-specific cleanup required immediately after loading an object.

Public function Virtual

void

 

Serialize

(
    FArchive& Ar
)

Handles reading, writing, and reference collecting using FArchive.

Overridden from IRVOAvoidanceInterface

Name Description

Public function Virtual

int32

 

GetAvoidanceGroupMask()

This actor's avoidance group mask

Public function Virtual

int32

 

GetGroupsToAvoidMask()

Agent groups to avoid mask

Public function Virtual

int32

 

GetGroupsToIgnoreMask()

Agent groups to ignore

Public function Virtual

float

 

GetRVOAvoidanceConsiderationRadius()

The scaled collider radius to consider for RVO avoidance

Public function Virtual

float

 

GetRVOAvoidanceHeight()

The scaled collider height to consider for RVO avoidance

Public function Virtual

FVector

 

GetRVOAvoidanceOrigin()

Get the Location from where the RVO avoidance should originate

Public function Virtual

float

 

GetRVOAvoidanceRadius()

The scaled collider radius to consider for RVO avoidance

Public function Virtual

int32

 

GetRVOAvoidanceUID()

Return the AvoidanceUID assigned by the Avoidance Manager during registration

Public function Virtual

float

 

GetRVOAvoidanceWeight()

Returns the AvoidanceWeight assigned by the Avoidance Manager during registration

Public function Virtual

FVector

 

GetVelocityForRVOConsideration()

The velocity of the avoiding entity

Public function Virtual

void

 

SetAvoidanceGroupMask

(
    int32 GroupFlags
)

Store the avoidance group mask

Public function Virtual

void

 

SetGroupsToAvoidMask

(
    int32 GroupFlags
)

Store the groups to avoid mask

Public function Virtual

void

 

SetGroupsToIgnoreMask

(
    int32 GroupFlags
)

Store the groups to ignore mask

Public function Virtual

void

 

SetRVOAvoidanceUID

(
    int32 UID
)

BEGIN IRVOAvoidanceInterface

Public function Virtual

void

 

SetRVOAvoidanceWeight

(
    float Weight
)

Store the AvoidanceWeight generated by the Avoidance Manager

Overridden from INetworkPredictionInterface

Name Description

Public function Virtual

bool

 

ForcePositionUpdate

(
    float DeltaTime
)

(Server) Trigger a position update on clients, if the server hasn't heard from them in a while.

Public function Virtual Const

FNetworkPred...

 

GetPredictionData_Client()

Get prediction data for a client game.

Public function Virtual Const

FNetworkPred...

 

GetPredictionData_Server()

Get prediction data for a server game.

Public function Virtual Const

bool

 

HasPredictionData_Client()

Accessor to check if there is already client data, without potentially allocating it on demand.

Public function Virtual Const

bool

 

HasPredictionData_Server()

Accessor to check if there is already server data, without potentially allocating it on demand.

Public function Virtual

void

 

ResetPredictionData_Client()

Resets client prediction data.

Public function Virtual

void

 

ResetPredictionData_Server()

Resets server prediction data.

Public function Virtual

void

 

SendClientAdjustment()

Server hook.

Public function Virtual

void

 

SmoothCorrection

(
    const FVector& OldLocation,
    const FQuat& OldRotation,
    const FVector& NewLocation,
    const FQuat& NewRotation
)

Client hook.

Enums

Name

Description

Public enum

ERootMotionMapping

Collection of the most recent ID mappings

Constants

Name

Description

BRAKE_TO_STOP_VELOCITY

Stop completely when braking and velocity magnitude is lower than this.

DefaultGravityDirection

The default direction that gravity points for movement simulation.

MAX_FLOOR_DIST

Maximum acceptable distance for Character capsule to float above floor when walking.

MIN_FLOOR_DIST

Minimum acceptable distance for Character capsule to float above floor when walking.

MIN_TICK_TIME

Minimum delta time considered when ticking.

SWEEP_EDGE_REJECT_DISTANCE

Reject sweep impacts that are this close to the edge of the vertical portion of the capsule when performing vertical sweeps, and try again with a smaller capsule.

Deprecated Variables

Name Description

Public variable

uint32: 1

 

bForceBraking_DEPRECATED

Deprecated properties.

Public variable

float

 

CrouchedSpeedMultiplier_DEPRECATED

Multiplier to max ground speed to use when crouched

Public variable

float

 

UpperImpactNormalScale_DEPRECATED

See Also

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