Language:
Discover
By Skill Level
By Category

UCharacterMovementComponent

Choose your OS:

Inheritance Hierarchy

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

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

uint32 : 1

 

bAllowPhysicsRotationDuringAnimRootMotion

Public variable

uint32 : 1

 

bAlwaysCheckFloor

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

Public variable

uint32 : 1

 

bApplyGravityWhileJumping

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

Public variable

uint32 : 1

 

bCanWalkOffLedges

If true, Character can walk off a ledge.

Public variable

uint32 : 1

 

bCanWalkOffLedgesWhenCrouching

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

Public variable

uint32 : 1

 

bCheatFlying

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

Public variable

uint32 : 1

 

bCrouchMaintainsBaseLocation

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

Protected variable

uint32 : 1

 

bDeferUpdateBasedMovement

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

Public variable

uint32 : 1

 

bDeferUpdateMoveComponent

True to update CharacterOwner and UpdatedComponent after movement ends

Public variable

bool

 

bEnablePhysicsInteraction

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

Public variable

uint32 : 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

uint32 : 1

 

bFastAttachedMove

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

Public variable

uint32 : 1

 

bForceMaxAccel

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

Public variable

uint32 : 1

 

bForceNextFloorCheck

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

Protected variable

uint32 : 1

 

bHasRequestedVelocity

AI PATH FOLLOWING.

Public variable

uint32 : 1

 

bIgnoreBaseRotation

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

Public variable

uint32 : 1

 

bIgnoreClientMovementErrorChecksAndCorrection

True when we should ignore server location difference checks for client error on this movement component This can be useful when character is moving at extreme speeds for a duration and you need it to look smooth on clients.

Public variable

uint32 : 1

 

bImpartBaseAngularVelocity

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

Public variable

uint32 : 1

 

bImpartBaseVelocityX

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

Public variable

uint32 : 1

 

bImpartBaseVelocityY

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

Public variable

uint32 : 1

 

bImpartBaseVelocityZ

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

Public variable

uint32 : 1

 

bIsNavWalkingOnServer

Set on clients when server's movement mode is NavWalking

Public variable

uint32 : 1

 

bJustTeleported

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

Public variable

uint32 : 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

uint32 : 1

 

bMovementInProgress

True during movement update.

Public variable

uint32 : 1

 

bNetworkAlwaysReplicateTransformUpdateTimestamp

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

Public variable

uint32 : 1

 

bNetworkLargeClientCorrection

Flag indicating the client correction was larger than NetworkLargeClientCorrectionThreshold.

Public variable

uint32 : 1

 

bNetworkMovementModeChanged

True when the networked movement mode has been replicated.

Public variable

uint32 : 1

 

bNetworkSkipProxyPredictionOnNetUpdate

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

Public variable

uint32 : 1

 

bNetworkSmoothingComplete

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

Public variable

uint32 : 1

 

bNetworkUpdateReceived

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

Public variable

uint32 : 1

 

bNotifyApex

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

Public variable

uint32 : 1

 

bOrientRotationToMovement

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

Public variable

uint32 : 1

 

bPerformingJumpOff

Used to prevent reentry of JumpOff()

Protected variable

uint32 : 1

 

bProjectNavMeshOnBothWorldChannels

Use both WorldStatic and WorldDynamic channels for NavWalking geometry conforming

Protected variable

uint32 : 1

 

bProjectNavMeshWalking

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

Public variable

bool

 

bPushForceScaledToMass

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

Public variable

bool

 

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

uint32 : 1

 

bRequestedMoveUseAcceleration

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

Protected variable

uint32 : 1

 

bRequestedMoveWithMaxSpeed

Was acceleration requested to be always max speed?

Public variable

uint32 : 1

 

bRunPhysicsWithNoController

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

Public variable

bool

 

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

uint32 : 1

 

bShrinkProxyCapsule

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

Public variable

uint32 : 1

 

bSweepWhileNavWalking

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

Public variable

bool

 

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

uint32 : 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

uint32 : 1

 

bUseFlatBaseForFloorChecks

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

Public variable

uint32 : 1

 

bUseRVOAvoidance

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

Protected variable

uint32 : 1

 

bUseRVOPostProcess

If set, PostProcessAvoidanceVelocity will be called

Public variable

uint32 : 1

 

bUseSeparateBrakingFriction

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

Public variable

uint32 : 1

 

bWantsToCrouch

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

Public variable

uint32 : 1

 

bWantsToLeaveNavWalking

Used to safely leave NavWalking movement mode

Protected variable

uint32 : 1

 

bWasAvoidanceUpdated

Was avoidance updated in this frame?

Public variable

bool

 

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

ACharacter *...

 

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.

Public variable

uint8

 

CustomMovementMode

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

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

USceneComponent ...

 

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

 

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.

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.

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

float

 

MaxOutOfWaterStepHeight

Maximum step height for getting out of water

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.

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

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.

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.

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

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 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.

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

(
    FRootMotionSource * SourcePtr
)

Apply a RootMotionSource to current root motion

LocalID for this Root Motion Source

Protected function

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.

Public function Virtual

FVector

 

CalcAnimRootMotionVelocity

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

Calculate velocity from anim root motion.

Public function Virtual

void

 

CalcAvoidanceVelocity

(
    float DeltaTime
)

RVO Avoidance.

Public function Virtual

FVector

 

CalcRootMotionVelocity

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

TODO: Deprecated, remove.

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.

Public function Virtual

bool

 

CanCrouchInCurrentState()

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

bool

 

CanStepUp

(
    const FHitResult & Hit
)

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

Public function Virtual

bool

 

CanWalkOffLedges()

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

bool

 

CheckLedgeDirection

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

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
)

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
)

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
)

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
)

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
)

Protected function Virtual

float

 

ComputeAnalogInputModifier()

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

Public function Virtual

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

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

FRotator

 

ComputeOrientToMovementRotation

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

Compute a target rotation based on current movement.

Public function Virtual

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

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

FVector

 

ConstrainInputAcceleration

(
    const FVector & InputAcceleration
)

Enforce constraints on input given current state.

Public function

FTransform

 

ConvertLocalRootMotionToWorld

(
    const FTransform & InLocalRootMotio...
)

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.

Public function Virtual

void

 

DisableMovement()

WITH_EDITOR.

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

 

FindBestNavMeshLocation

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

Performs trace for ProjectLocationFromNavMesh

Public function Virtual

void

 

FindFloor

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

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

Public function Virtual

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

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

float

 

GetAnalogInputModifier()

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

FVector

 

GetBestDirectionOffActor

(
    AActor * BaseActor
)

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

Public function

ACharacter &...

 

GetCharacterOwner()

Get the Character that owns UpdatedComponent.

Protected function Virtual

float

 

GetClientNetSendDeltaTime

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

Determine minimum delay between sending client updates to the server.

Public function

FVector

 

GetCurrentAcceleration()

Current acceleration, computed from input vector each update.

Public function Virtual

FRotator

 

GetDeltaRotation

(
    float DeltaTime
)

How far to rotate character during the time interval DeltaTime.

Public function Virtual

FVector

 

GetFallingLateralAcceleration

(
    float DeltaTime
)

Helpers for PhysFalling.

Public function

EMovementMod ...

 

GetGroundMovementMode()

Get current GroundMovementMode value.

current GroundMovementMode

Public function Virtual

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 Virtual

FVector

 

GetLedgeMove

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

New delta which moves along the ledge

Public function Virtual

float

 

GetMaxAcceleration()

Maximum acceleration for the current state.

Public function Virtual

float

 

GetMaxBrakingDeceleration()

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

Public function Virtual

float

 

GetMaxJumpHeight()

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

Public function Virtual

float

 

GetMaxJumpHeightWithJumpTime()

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

Public function Virtual

float

 

GetMinAnalogSpeed()

Maximum acceleration for the current state.

Public function Virtual

float

 

GetModifiedMaxAcceleration()

TODO: deprecated, remove.

Public function

UPrimitiveCo ...

 

GetMovementBase()

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

Public function Virtual

FString

 

GetMovementName()

MovementMode string

Protected function

const INavig ...

 

GetNavData()

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

Public function Virtual

float

 

GetNetworkSafeRandomAngleDegrees()

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

Protected function

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

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

float

 

GetPerchRadiusThreshold()

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

FNetworkPred ...

 

GetPredictionData_Client_Character()

Public function

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

float

 

GetServerLastTransformUpdateTimeStamp()

Get the value of ServerLastTransformUpdateTimeStamp.

Public function

float

 

GetSimulationTimeStep

(
    float RemainingTime,
    int32 Iterations
)

Compute remaining time step given remaining time and current iterations.

Public function

ETeleportTyp ...

 

GetTeleportType()

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

Public function

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

float

 

GetWalkableFloorAngle()

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

Public function

float

 

GetWalkableFloorZ()

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

Public function Virtual

bool

 

HandlePendingLaunch()

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

Protected function Virtual

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

bool

 

HasAnimRootMotion()

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

Public function

bool

 

HasRootMotionSources()

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

Public function Virtual

bool

 

HasValidData()

Return true if we have a valid CharacterOwner and UpdatedComponent.

Public function Virtual

float

 

ImmersionDepth()

Determine how deep in water the character is immersed.

Protected function

bool

 

IsClientTimeStampValid

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

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

Public function

bool

 

IsMovementInProgress()

True if currently performing a movement update.

Public function Virtual

bool

 

IsValidLandingSpot

(
    const FVector & CapsuleLocation,
    const FHitResult & Hit
)

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

Public function Virtual

bool

 

IsWalkable

(
    const FHitResult & Hit
)

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

Public function

bool

 

IsWalking()

END UMovementComponent Interface.

Public function Virtual

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

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

void

 

K2_FindFloor

(
    FVector CapsuleLocation,
    FFindFloorResult & FloorResult
)

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

Public function Virtual

float

 

K2_GetModifiedMaxAcceleration()

TODO: deprecated, remove.

Public function

float

 

K2_GetWalkableFloorAngle()

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

Public function

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 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

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
)

Event notification when client receives a correction from the server.

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

uint8

 

PackNetworkMovementMode()

Protected function Static

uint32

 

PackYawAndPitchTo32

(
    const float Yaw,
    const float Pitch
)

Public function Virtual

void

 

PerformAirControlForPathFollowing

(
    FVector Direction,
    float ZDiff
)

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()

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

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).

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 Virtual

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

FVector

 

ScaleInputAcceleration

(
    const FVector & InputAcceleration
)

Scale input acceleration, based on movement acceleration rate.

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.

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
)

Network RPCs for movement.

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
)

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
)

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
)

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
)

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
)

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
)

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
)

Public function Virtual

bool

 

ServerMoveOld_Validate

(
    float OldTimeStamp,
    FVector_NetQuantize10 OldAccel,
    uint8 OldMoveFlags
)

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 Virtual

void

 

SetDefaultMovementMode()

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

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 Virtual

void

 

SetNavWalkingPhysics

(
    bool bEnable
)

Switch collision settings for NavWalking mode (ignore world collisions)

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

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

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).

Public function Virtual

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

bool

 

ShouldJumpOutOfWater

(
    FVector & JumpDir
)

Calculates the best direction to go to "jump off" an actor.

Public function Virtual

bool

 

ShouldRemainVertical()

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

Protected function

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

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,
    UCharacterMovementComponent::FStepD ...
)

Move up steps or slope.

Public function

float

 

Swim

(
    FVector Delta,
    FHitResult & Hit
)

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

Protected function

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

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

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

void

 

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
)

END UNaVMovementComponent Interface.

Overridden from UNavMovementComponent

Name Description

Public function Virtual

bool

 

CanStartPathFollowing()

True if path following can start

Public function Virtual

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

float

 

GetPathFollowingBrakingDistance

(
    float MaxSpeed
)

Braking distance for acceleration driven path following

Public function Virtual

bool

 

IsCrouching()

True if currently crouching

Public function Virtual

bool

 

IsFalling()

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

Public function Virtual

bool

 

IsFlying()

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

Public function Virtual

bool

 

IsMovingOnGround()

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

Public function Virtual

bool

 

IsSwimming()

True if currently swimming (moving through a fluid volume)

Public function Virtual

void

 

RequestDirectMove

(
    const FVector & MoveVelocity,
    bool bForceMaxSpeed
)

BEGIN UNavMovementComponent Interface.

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

FVector

 

ComputeSlideVector

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

Calculate slide vector along a surface.

Public function Virtual

float

 

GetGravityZ()

WITH_EDITOR.

Public function Virtual

float

 

GetMaxSpeed()

End UActorComponent Interface.

Protected function Virtual

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

void

 

TwoWallAdjust

(
    FVector & Delta,
    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

 

Deactivate()

Deactivates the SceneComponent.

Public function Virtual

void

 

OnRegister()

WITH_EDITOR.

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...
)

End UObject Interface.

Overridden from UObject

Name Description

Public function Virtual

void

 

BeginDestroy()

Called before destroying the object.

Public function Virtual

void

 

PostEditChangeProperty

(
    FPropertyChangedEvent & PropertyCha...
)

End UPawnMovementComponent Interface.

Public function Virtual

void

 

PostLoad()

Do any object-specific cleanup required immediately after loading an object, and immediately after any undo/redo.

Public function Virtual

void

 

Serialize

(
    FArchive & Archive
)

Begin UObject Interface.

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

 

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

void

 

ForcePositionUpdate

(
    float DeltaTime
)

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

Public function Virtual

FNetworkPred ...

 

GetPredictionData_Client()

Get prediction data for a client game.

Public function Virtual

FNetworkPred ...

 

GetPredictionData_Server()

Get prediction data for a server game.

Public function Virtual

bool

 

HasPredictionData_Client()

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

Public function Virtual

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()

INetworkPredictionInterface implementation -----------------------------Server hook

Public function Virtual

void

 

SmoothCorrection

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

Client hook

Classes

Name

Description

Public struct

FStepDownResult

Struct updated by StepUp() to return result of final step down, if applicable.

Enums

Name

Description

Public enum

ERootMotionMapping

Collection of the most recent ID mappings

Protected enum

EShrinkCapsuleExtent

Enum used to control GetPawnCapsuleExtent behavior.

Constants

Name

Description

BRAKE_TO_STOP_VELOCITY

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

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

Slope is vertical if Abs(Normal.Z) <= this threshold. Accounts for precision problems that sometimes angle normals slightly off horizontal for vertical surface.

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.

See Also

References

Module

Engine

Header

Runtime/Engine/Classes/GameFramework/CharacterMovementComponent.h