Navigation
API > API/Runtime > API/Runtime/Engine > API/Runtime/Engine/GameFramework
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- UActorComponent
- UMovementComponent
- UNavMovementComponent
- UPawnMovementComponent
- UCharacterMovementComponent
References
| Module | Engine |
| Header | /Engine/Source/Runtime/Engine/Classes/GameFramework/CharacterMovementComponent.h |
| Include | #include "GameFramework/CharacterMovementComponent.h" |
Syntax
UCLASS (MinimalAPI)
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
| Type | Name | Description | |
|---|---|---|---|
| FVector | Acceleration | Current acceleration vector (with magnitude). | |
| float | AirControl | When falling, amount of lateral movement control available to the character. | |
| float | AirControlBoostMultiplier | When falling, multiplier applied to AirControl when lateral velocity is less than AirControlBoostVelocityThreshold. | |
| float | AirControlBoostVelocityThreshold | When falling, if lateral velocity magnitude is less than this value, AirControl is multiplied by AirControlBoostMultiplier. | |
| float | AnalogInputModifier | Modifier to applied to values such as acceleration and max speed due to analog input. | |
| FVector | AnimRootMotionVelocity | Velocity extracted from RootMotionParams when there is anim root motion active. | |
| FRootMotionAsyncData | AsyncRootMotion | ||
| TSharedPtr< FCharacterMovementComponentAsyncOutput, ESPMode::ThreadSafe > | AsyncSimState | This is the most recent async state from simulated. Only safe for access on physics thread. | |
| float | AvoidanceConsiderationRadius | ||
| FNavAvoidanceMask | AvoidanceGroup | Moving actor's group mask | |
| float | AvoidanceLockTimer | Remaining time of avoidance velocity lock | |
| FVector | AvoidanceLockVelocity | Forced avoidance velocity, used when AvoidanceLockTimer is > 0 | |
| int32 | AvoidanceUID | No default value, for now it's assumed to be valid if GetAvoidanceManager() returns non-NULL. | |
| float | AvoidanceWeight | De facto default value 0.5 (due to that being the default in the avoidance registration function), indicates RVO behavior. | |
| uint8: 1 | bAllowPhysicsRotationDuringAnimRootMotion | ||
| uint8: 1 | bAlwaysCheckFloor | Whether we always force floor checks for stationary Characters while walking. | |
| uint8: 1 | bApplyGravityWhileJumping | Apply gravity while the character is actively jumping (e.g. holding the jump key). | |
| bool | bBasedMovementIgnorePhysicsBase | Property to set if UpdateBasedMovement should ignore collision with actors part of the current MovementBase, if the base is simulated by physics | |
| bool | bBaseOnAttachmentRoot | Property to set if characters should stay based on objects attachment root instead of the traced object | |
| float FVectorFVector_NetQuantizeNormal float UPrimitiveComponentFName bool bool | bBaseRelativePosition | ||
| FVectorFVectorUPrimitiveComponentFName bool bool | bBaseRelativePosition | ||
| FRootMotionSourceGroup bool float FVectorFVector_NetQuantizeNormal float UPrimitiveComponentFName bo... | bBaseRelativePosition | ||
| FVectorUPrimitiveComponentFName bool bool | bBaseRelativePosition | ||
| bool | bCanTrustClientOnLanding | Whether we're stepping off a moving platform (and should trust the client somewhat when landing). | |
| uint8: 1 | bCanWalkOffLedges | If true, Character can walk off a ledge. | |
| uint8: 1 | bCanWalkOffLedgesWhenCrouching | If true, Character can walk off a ledge when crouching. | |
| uint8: 1 | bCheatFlying | Instantly stop when in flying mode and no acceleration is being applied. | |
| uint8: 1 | bCrouchMaintainsBaseLocation | If true, crouching should keep the base of the capsule in place by lowering the center of the shrunken capsule. | |
| uint8: 1 | bDeferUpdateBasedMovement | Flag set in pre-physics update to indicate that based movement should be updated post-physics | |
| uint8: 1 | bDeferUpdateMoveComponent | True to update CharacterOwner and UpdatedComponent after movement ends | |
| uint8: 1 | bDontFallBelowJumpZVelocityDuringJump | True means while the jump key is held, we will not allow the vertical speed to fall below the JumpZVelocity tuning value even if a stronger force, such as gravity, is opposing the jump. | |
| uint8: 1 | bEnablePhysicsInteraction | If enabled, the player will interact with physics objects when walking into them. | |
| 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. | |
| 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. | |
| uint8: 1 | bFastAttachedMove | Set this to true if riding on a moving base that you know is clear from non-moving world obstructions. | |
| uint8: 1 | bForceMaxAccel | Ignores size of acceleration component, and forces max acceleration to drive character at full velocity. | |
| uint8: 1 | bForceNextFloorCheck | Force the Character in MOVE_Walking to do a check for a valid floor even if it hasn't moved. | |
| FRootMotionSourceGroup bool | bHasAnimRootMotion | ||
| FVectorUPrimitiveComponentFName bool | bHasBase | ||
| FVectorFVectorUPrimitiveComponentFName bool | bHasBase | ||
| float FVectorFVector_NetQuantizeNormal float UPrimitiveComponentFName bool | bHasBase | ||
| FRootMotionSourceGroup bool float FVectorFVector_NetQuantizeNormal float UPrimitiveComponentFName bo... | bHasBase | ||
| uint8: 1 | bHasRequestedVelocity | Was velocity requested by path following? | |
| uint8: 1 | bIgnoreBaseRotation | Whether the character ignores changes in rotation of the base it is standing on. | |
| uint8: 1 | bIgnoreClientMovementErrorChecksAndCorrection | If true, we should ignore server location difference checks for client error on this movement component. | |
| uint8: 1 | bImpartBaseAngularVelocity | If true, impart the base component's tangential components of angular velocity when jumping or falling off it. | |
| uint8: 1 | bImpartBaseVelocityX | If true, impart the base actor's X velocity when falling off it (which includes jumping) | |
| uint8: 1 | bImpartBaseVelocityY | If true, impart the base actor's Y velocity when falling off it (which includes jumping) | |
| uint8: 1 | bImpartBaseVelocityZ | If true, impart the base actor's Z velocity when falling off it (which includes jumping) | |
| uint8: 1 | bIsNavWalkingOnServer | Set on clients when server's movement mode is NavWalking | |
| uint8: 1 | bJustTeleported | Used by movement code to determine if a change in position is based on normal movement or a teleport. | |
| bool | bLastClientIsFalling | Remember if the client was previously falling so we can tell when they've just landed. | |
| bool | bLastServerIsFalling | Remember if the server was previously falling so we can tell when they've just landed. | |
| bool | bLastServerIsWalking | Whether we were just walking on something, used to help with transitions off moving objects. | |
| 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. | |
| uint8: 1 | bMovementInProgress | True during movement update. | |
| bool | bMovementModeDirty | ||
| uint8: 1 | bNetworkAlwaysReplicateTransformUpdateTimestamp | Flag used on the server to determine whether to always replicate ReplicatedServerLastTransformUpdateTimeStamp to clients. | |
| uint8: 1 | bNetworkGravityDirectionChanged | True when the networked gravity direction has been replicated. | |
| uint8: 1 | bNetworkLargeClientCorrection | Flag indicating the client correction was larger than NetworkLargeClientCorrectionThreshold. | |
| uint8: 1 | bNetworkMovementModeChanged | True when the networked movement mode has been replicated. | |
| uint8: 1 | bNetworkSkipProxyPredictionOnNetUpdate | Whether we skip prediction on frames where a proxy receives a network update. | |
| uint8: 1 | bNetworkSmoothingComplete | Signals that smoothed position/rotation has reached target, and no more smoothing is necessary until a future update. | |
| uint8: 1 | bNetworkUpdateReceived | True when a network replication update is received for simulated proxies. | |
| uint8: 1 | bNotifyApex | If true, event NotifyJumpApex() to CharacterOwner's controller when at apex of jump. | |
| uint8: 1 | bOrientRotationToMovement | If true, rotate the Character toward the direction of acceleration, using RotationRate as the rate of rotation change. | |
| uint8: 1 | bPerformingJumpOff | Used to prevent reentry of JumpOff() | |
| uint8: 1 | bProjectNavMeshOnBothWorldChannels | Use both WorldStatic and WorldDynamic channels for NavWalking geometry conforming | |
| uint8: 1 | bProjectNavMeshWalking | Whether to raycast to underlying geometry to better conform navmesh-walking characters | |
| uint8: 1 | bPushForceScaledToMass | If enabled, the PushForceFactor is applied per kg mass of the affected object. | |
| uint8: 1 | bPushForceUsingZOffset | If enabled, the PushForce location is moved using PushForcePointZOffsetFactor. | |
| float | BrakingDecelerationFalling | Lateral deceleration when falling and not applying acceleration. | |
| float | BrakingDecelerationFlying | Deceleration when flying and not applying acceleration. | |
| float | BrakingDecelerationSwimming | Deceleration when swimming and not applying acceleration. | |
| float | BrakingDecelerationWalking | Deceleration when walking and not applying acceleration. | |
| 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. | |
| float | BrakingFrictionFactor | Factor used to multiply actual value of friction used when braking. | |
| float | BrakingSubStepTime | Time substepping when applying braking friction. | |
| uint8: 1 | bRequestedMoveUseAcceleration | Should use acceleration for path following? If true, acceleration is applied when path following to reach the target velocity. | |
| uint8: 1 | bRequestedMoveWithMaxSpeed | Was acceleration requested to be always max speed? | |
| uint8: 1 | bRunPhysicsWithNoController | If true, movement will be performed even if there is no Controller for the Character owner. | |
| 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. | |
| 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. | |
| uint8: 1 | bShrinkProxyCapsule | If true, the capsule needs to be shrunk on this simulated proxy, to avoid replication rounding putting us in geometry. | |
| bool | bStayBasedInAir | Property to set if characters should stay based on objects while jumping | |
| uint8: 1 | bSweepWhileNavWalking | Whether or not the character should sweep for collision geometry while walking. | |
| 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. | |
| uint8: 1 | bTouchForceScaledToMass | If enabled, the TouchForceFactor is applied per kg mass of the affected object. | |
| float | Buoyancy | Water buoyancy. A ratio (1.0 = neutral buoyancy, 0.0 = no buoyancy) | |
| 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. | |
| uint8: 1 | bUseFlatBaseForFloorChecks | Performs floor checks as if the character is using a shape with a flat base. | |
| uint8: 1 | bUseRVOAvoidance | If set, component will use RVO avoidance. This only runs on the server. | |
| uint8: 1 | bUseRVOPostProcess | If set, PostProcessAvoidanceVelocity will be called | |
| uint8: 1 | bUseSeparateBrakingFriction | If true, BrakingFriction will be used to slow the character to a stop (when there is no Acceleration). | |
| uint8: 1 | bWantsToCrouch | If true, try to crouch (or keep crouching) on next update. | |
| uint8: 1 | bWantsToLeaveNavWalking | Used to safely leave NavWalking movement mode | |
| uint8: 1 | bWasAvoidanceUpdated | Was avoidance updated in this frame? | |
| uint8: 1 | bWasSimulatingRootMotion | True when SimulatedProxies are simulating RootMotion | |
| FNavLocation | CachedNavLocation | Last known location projected on navmesh, used by NavWalking mode | |
| FHitResult | CachedProjectedNavMeshHitResult | Last valid projected hit result from raycast to geometry from navmesh | |
| TObjectPtr< ACharacter > | CharacterOwner | Character movement component belongs to | |
| FVector_NetQuantize10FVector_NetQuantize100uint8uint8uint32UPrimitiveComponentFName | ClientBaseBoneName | ||
| FVector_NetQuantize10uint8uint32 float FVector_NetQuantize10FVector_NetQuantize100uint8uint8uint32UP... | ClientBaseBoneName | ||
| FVector_NetQuantize10FVector_NetQuantize100 | ClientLoc | ||
| FVector_NetQuantize10uint8uint32 float FVector_NetQuantize10FVector_NetQuantize100 | ClientLoc | ||
| FVector_NetQuantize10FVector_NetQuantize100uint8uint8uint32UPrimitiveComponent * | ClientMovementBase | ||
| FVector_NetQuantize10uint8uint32 float FVector_NetQuantize10FVector_NetQuantize100uint8uint8uint32UP... | ClientMovementBase | ||
| FVector_NetQuantize10uint8uint32 float FVector_NetQuantize10FVector_NetQuantize100uint8uint8uint32UP... | ClientMovementMode | ||
| FVector_NetQuantize10FVector_NetQuantize100uint8uint8uint32UPrimitiveComponentFNameuint8 | ClientMovementMode | ||
| FNetworkPredictionData_Client_Character * | ClientPredictionData | ||
| FVector_NetQuantize10FVector_NetQuantize100uint8uint8 | ClientRoll | ||
| FVector_NetQuantize10uint8uint32 float FVector_NetQuantize10FVector_NetQuantize100uint8uint8 | ClientRoll | ||
| FVector_NetQuantize10FVector_NetQuantize100uint8 | CompressedMoveFlags | ||
| FFindFloorResult | CurrentFloor | Information about the floor the Character is standing on (updated only during walking movement). | |
| FRootMotionSourceGroup | CurrentRootMotion | Root Motion Group containing active root motion sources being applied to movement | |
| uint8 | CustomMovementMode | Current custom sub-mode if MovementMode is set to Custom. | |
| FVector | DecayingFormerBaseVelocity | Left over velocity when leaving a moving base. Helps with airborne root motion. | |
| TEnumAsByte< enum EMovementMode > | DefaultLandMovementMode | Default movement mode when not in water. Used at player startup or when teleported. | |
| TEnumAsByte< enum EMovementMode > | DefaultWaterMovementMode | Default movement mode when in water. Used at player startup or when teleported. | |
| TObjectPtr< USceneComponent > | DeferredUpdatedMoveComponent | What to update CharacterOwner and UpdatedComponent after movement ends | |
| float | FallingLateralFriction | Friction to apply to lateral air movement when falling. | |
| 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). | |
| float | GravityScale | Custom gravity scale. Gravity is multiplied by this amount for the character. | |
| float | GroundFriction | Setting that affects movement control. | |
| FNavAvoidanceMask | GroupsToAvoid | Will avoid other agents if they are in one of specified groups | |
| FNavAvoidanceMask | GroupsToIgnore | Will NOT avoid other agents if they are in one of specified groups, higher priority than GroupsToAvoid | |
| FVector_NetQuantize10uint8uint32 float FVector_NetQuantize10 | InAccel | ||
| FVector_NetQuantize10 | InAccel | ||
| FVector_NetQuantize10 | InAccel0 | ||
| float | InitialPushForceFactor | Initial impulse force to apply when the player bounces into a blocking physics object. | |
| 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. | |
| float | JumpOutOfWaterPitch | When exiting water, jump if control pitch angle is this high or above. | |
| float | JumpZVelocity | Initial velocity (instantaneous vertical acceleration) when jumping. | |
| FName | LastServerMovementBaseBoneName | Remember last server movement base bone so we can detect mounts/dismounts and respond accordingly. | |
| float | LastStuckWarningTime | Used for throttling "stuck in geometry" logging. | |
| float | LastTimeStampResetServerTime | Clock time on the server of the last timestamp reset. | |
| FVector | LastUpdateLocation | Location after last PerformMovement or SimulateMovement update. | |
| FVector | LastUpdateRequestedVelocity | Velocity requested by path following during last Update Updated when we consume the value | |
| FQuat | LastUpdateRotation | Rotation after last PerformMovement or SimulateMovement update. | |
| FVector | LastUpdateVelocity | Velocity after last PerformMovement or SimulateMovement update. | |
| float | LedgeCheckThreshold | Used in determining if pawn is going off ledge. | |
| float | ListenServerNetworkSimulatedSmoothLocationTime | Similar setting as NetworkSimulatedSmoothLocationTime but only used on Listen servers. | |
| float | ListenServerNetworkSimulatedSmoothRotationTime | Similar setting as NetworkSimulatedSmoothRotationTime but only used on Listen servers. | |
| float | Mass | Mass of pawn (for when momentum is imparted to it). | |
| float | MaxAcceleration | Max Acceleration (rate of change of velocity) | |
| float | MaxCustomMovementSpeed | The maximum speed when using Custom movement mode. | |
| float | MaxDepenetrationWithGeometry | Max distance we allow simulated proxies to depenetrate when moving out of anything but Pawns. | |
| float | MaxDepenetrationWithGeometryAsProxy | Max distance we allow simulated proxies to depenetrate when moving out of anything but Pawns. | |
| float | MaxDepenetrationWithPawn | Max distance we are allowed to depenetrate when moving out of other Pawns. | |
| float | MaxDepenetrationWithPawnAsProxy | Max distance we allow simulated proxies to depenetrate when moving out of other Pawns. | |
| float | MaxFlySpeed | The maximum flying speed. | |
| 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. | |
| float | MaxOutOfWaterStepHeight | Maximum step height for getting out of water | |
| float | MaxServerClientErrorWhileFalling | How loosely the client can follow the server location during this fall. | |
| int32 | MaxSimulationIterations | Max number of iterations used for each discrete simulation step. | |
| float | MaxSimulationTimeStep | Max time delta for each discrete simulation step. | |
| float | MaxStepHeight | Maximum height character can step up | |
| float | MaxSwimSpeed | The maximum swimming speed. | |
| float | MaxTouchForce | Maximum force applied to touched physics objects. If < 0.0f, there is no maximum. | |
| float | MaxWalkSpeed | The maximum ground speed when walking. Also determines maximum lateral speed when falling. | |
| float | MaxWalkSpeedCrouched | The maximum ground speed when walking and crouched. | |
| float | MinAnalogWalkSpeed | The ground speed that we should accelerate up to when walking at minimum analog stick tilt | |
| float | MinTimeBetweenTimeStampResets | Minimum time between client TimeStamp resets. | |
| float | MinTouchForce | Minimum Force applied to touched physics objects. If < 0.0f, there is no minimum. | |
| TEnumAsByte< enum EMovementMode > | MovementMode | Actor's current movement mode (walking, falling, etc). | |
| float | NavMeshProjectionHeightScaleDown | Scale of the total capsule height to use for projection from navmesh to underlying geometry in the downward direction. | |
| float | NavMeshProjectionHeightScaleUp | Scale of the total capsule height to use for projection from navmesh to underlying geometry in the upward direction. | |
| float | NavMeshProjectionInterpSpeed | Speed at which to interpolate agent navmesh offset between traces. | |
| float | NavMeshProjectionInterval | How often we should raycast to project from navmesh to underlying geometry | |
| float | NavMeshProjectionTimer | ||
| float | NavWalkingFloorDistTolerance | Ignore small differences in ground height between server and client data during NavWalking mode | |
| float | NetProxyShrinkHalfHeight | Shrink simulated proxy capsule half height by this amount, to account for network rounding that may cause encroachment. | |
| float | NetProxyShrinkRadius | Shrink simulated proxy capsule radius by this amount, to account for network rounding that may cause encroachment. | |
| float | NetworkLargeClientCorrectionDistance | If client error is larger than this, sets bNetworkLargeClientCorrection to reduce delay between client adjustments. | |
| float | NetworkMaxSmoothUpdateDistance | Maximum distance character is allowed to lag behind server location when interpolating between updates. | |
| float | NetworkMinTimeBetweenClientAckGoodMoves | Minimum time on the server between acknowledging good client moves. | |
| float | NetworkMinTimeBetweenClientAdjustments | Minimum time on the server between sending client adjustments when client has exceeded allowable position error. | |
| float | NetworkMinTimeBetweenClientAdjustmentsLargeCorrection | Minimum time on the server between sending client adjustments when client has exceeded allowable position error by a large amount (NetworkLargeClientCorrectionDistance). | |
| float | NetworkNoSmoothUpdateDistance | Maximum distance beyond which character is teleported to the new server location without any smoothing. | |
| 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. | |
| 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. | |
| ENetworkSmoothingMode | NetworkSmoothingMode | Smoothing mode for simulated proxies in network game. | |
| FVectorFVectorUPrimitiveComponent * | NewBase | ||
| FVectorUPrimitiveComponent * | NewBase | ||
| FVectorFVectorUPrimitiveComponentFName | NewBaseBoneName | ||
| FVectorUPrimitiveComponentFName | NewBaseBoneName | ||
| FVector_NetQuantize10uint8uint32 float FVector_NetQuantize10FVector_NetQuantize100uint8 | NewFlags | ||
| FVector | NewLoc | ||
| FVectorFVector | NewVel | ||
| int32 | NumJumpApexAttempts | Used to limit number of jump apex attempts per tick. | |
| FVector_NetQuantize10 | OldAccel | ||
| 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. | |
| 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. | |
| const FSavedMove_Character * | OldMove | ||
| FVector_NetQuantize10uint8 | OldMoveFlags | ||
| float | OutofWaterZ | Z velocity applied when pawn tries to get out of water | |
| FVector_NetQuantize10uint8 | PendingFlags | ||
| FVector | PendingForceToApply | Accumulated force to be added next tick. | |
| FVector | PendingImpulseToApply | Accumulated impulse to be added next tick. | |
| FVector | PendingLaunchVelocity | Temporarily holds launch velocity when pawn is to be launched so it happens at end of movement. | |
| float | PerchAdditionalHeight | When perching on a ledge, add this additional distance to MaxStepHeight when determining how high above a walkable floor we can perch. | |
| 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. | |
| FCharacterMovementComponentPostPhysicsTickFunction | PostPhysicsTickFunction | Post-physics tick function for this character | |
| FCharacterMovementComponentPrePhysicsTickFunction | PrePhysicsTickFunction | Pre-physics tick function for this character | |
| FOnProcessRootMotion | ProcessRootMotionPostConvertToWorld | Delegate for modifying root motion post conversion from component space to world space. | |
| FOnProcessRootMotion | ProcessRootMotionPreConvertToWorld | Delegate for modifying root motion pre conversion from component space to world space. | |
| float | PushForceFactor | Force to apply when the player collides with a blocking physics object. | |
| float | PushForcePointZOffsetFactor | Z-Offset for the position the force is applied to. | |
| FRandomStream | RandomStream | ||
| float | RepulsionForce | Force per kg applied constantly to all overlapping components. | |
| FVector | RequestedVelocity | Velocity requested by path following. | |
| TArray< FRootMotionServerToLocalIDMapping, TInlineAllocator<(uint32) ERootMotionMapping::MapSize > > | RootMotionIDMappings | ||
| FRootMotionMovementParams | RootMotionParams | Animation root motion (special case for now) Root Motion movement params. | |
| FRotator | RotationRate | Change in rotation per second, used when UseControllerDesiredRotation or OrientRotationToMovement are true. | |
| FRootMotionSourceGroup bool float FVectorFVector_NetQuantizeNormal float UPrimitiveComponent * | ServerBase | ||
| float FVectorFVector_NetQuantizeNormal float UPrimitiveComponent * | ServerBase | ||
| float FVectorFVector_NetQuantizeNormal float UPrimitiveComponentFName | ServerBoneName | ||
| FRootMotionSourceGroup bool float FVectorFVector_NetQuantizeNormal float UPrimitiveComponentFName | ServerBoneName | ||
| FRootMotionSourceGroup | ServerCorrectionRootMotion | ||
| float | ServerLastClientAdjustmentTime | Timestamp of last client adjustment sent. See NetworkMinTimeBetweenClientAdjustments. | |
| float | ServerLastClientGoodMoveAckTime | Timestamp of last client adjustment sent. See NetworkMinTimeBetweenClientAdjustments. | |
| float | ServerLastTransformUpdateTimeStamp | Timestamp when location or rotation last changed during an update. Only valid on the server. | |
| float FVector | ServerLoc | ||
| FRootMotionSourceGroup bool float FVector | ServerLoc | ||
| FRootMotionSourceGroup bool float | ServerMontageTrackPosition | ||
| float | ServerMontageTrackPosition | ||
| float FVectorFVector_NetQuantizeNormal float UPrimitiveComponentFName bool bool uint8 | ServerMovementMode | ||
| FVectorUPrimitiveComponentFName bool bool uint8 | ServerMovementMode | ||
| FVectorFVectorUPrimitiveComponentFName bool bool uint8 | ServerMovementMode | ||
| FRootMotionSourceGroup bool float FVectorFVector_NetQuantizeNormal float UPrimitiveComponentFName bo... | ServerMovementMode | ||
| FNetworkPredictionData_Server_Character * | ServerPredictionData | ||
| FRootMotionSourceGroup | ServerRootMotion | ||
| float FVectorFVector_NetQuantizeNormal | ServerRotation | ||
| FRootMotionSourceGroup bool float FVectorFVector_NetQuantizeNormal | ServerRotation | ||
| FRootMotionSourceGroup bool float FVectorFVector_NetQuantizeNormal float | ServerVelZ | ||
| float FVectorFVector_NetQuantizeNormal float | ServerVelZ | ||
| float | StandingDownwardForceScale | Force applied to objects we stand on (due to Mass and Gravity) is scaled by this amount. | |
| float | StayBasedInAirHeight | Property used to set how high above base characters should stay based on objects while jumping if bStayBasedInAir is set | |
| uint32 | StuckWarningCountSinceNotify | Used when throttling "stuck in geometry" logging, to output the number of events we skipped if throttling. | |
| FVector_NetQuantize10uint8uint32 float | TimeStamp | ||
| float | TouchForceFactor | Force to apply to physics objects that are touched by the player. | |
| FVector_NetQuantize10FVector_NetQuantize100uint8uint8uint32 | View | ||
| FVector_NetQuantize10uint8uint32 float FVector_NetQuantize10FVector_NetQuantize100uint8uint8uint32 | View | ||
| FVector_NetQuantize10uint8uint32 | View0 |
Constructors
| Type | Name | Description | |
|---|---|---|---|
UCharacterMovementComponent
(
const FObjectInitializer& ObjectInitializer |
Default UObject constructor. |
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | AccumulateRootMotionForAsync
(
float DeltaSeconds, |
Prepare root motion to be passed on to physics thread | |
| void | Add force to character. | ||
| void | AddImpulse
(
FVector Impulse, |
Add impulse to character. | |
| void | AddReferencedObjects
(
UObject* InThis, |
||
| void | Adjust distance from floor, trying to maintain a slight offset from the floor when walking (based on CurrentFloor). | ||
| void | Adjust the size of the capsule on simulated proxies, to avoid overlaps due to replication rounding. | ||
| void | ApplyAccumulatedForces
(
float DeltaSeconds |
Applies momentum accumulated through AddImpulse() and AddForce(), then clears those forces. | |
| void | Apply outputs from async sim. | ||
| void | ApplyDownwardForce
(
float DeltaSeconds |
Applies downward force when walking on top of physics objects. | |
| void | ApplyImpactPhysicsForces
(
const FHitResult& Impact, |
Apply physics forces to the impacted component, if bEnablePhysicsInteraction is true. | |
| void | Apply inherited velocity when leaving base, for example from jumping off it | ||
| void | ApplyNetworkMovementMode
(
const uint8 ReceivedMode |
||
| void | ApplyRepulsionForce
(
float DeltaSeconds |
Applies repulsion force to all touched components. | |
| bool | ApplyRequestedMove
(
float DeltaTime, |
Use velocity requested by path following to compute a requested acceleration and speed. | |
| uint16 | ApplyRootMotionSource
(
TSharedPtr< FRootMotionSource > SourcePtr |
Apply a RootMotionSource to current root motion | |
| void | ApplyRootMotionToVelocity
(
float deltaTime |
Applies root motion from root motion sources to velocity (override and additive) | |
| void | ApplyVelocityBraking
(
float DeltaTime, |
Slows towards stop. | |
| float | BoostAirControl
(
float DeltaTime, |
Increase air control if conditions of AirControlBoostMultiplier and AirControlBoostVelocityThreshold are met. | |
| void | |||
| FVector | CalcAnimRootMotionVelocity
(
const FVector& RootMotionDeltaMove, |
Calculate velocity from anim root motion. | |
| void | CalcAvoidanceVelocity
(
float DeltaTime |
Calculate RVO avoidance and apply it to current velocity | |
| void | CalcVelocity
(
float DeltaTime, |
Updates Velocity and Acceleration based on the current state, applying the effects of friction and acceleration or deceleration. | |
| void | CallMovementUpdateDelegate
(
float DeltaSeconds, |
Internal function to call OnMovementUpdated delegate on CharacterOwner. | |
| void | CallServerMovePacked
(
const FSavedMove_Character* NewMove, |
On the client, calls the ServerMovePacked_ClientSend() function with packed movement data. | |
| bool | Returns true if current movement state allows an attempt at jumping. Used by Character::CanJump(). | ||
| bool | Returns true if the character is allowed to crouch in the current state. | ||
| 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. | |
| bool | CanStepUp
(
const FHitResult& Hit |
Returns true if we can step up on the actor in the given FHitResult. | |
| bool | Returns whether this pawn is currently allowed to walk off ledges | ||
| void | CapsuleTouched
(
UPrimitiveComponent* OverlappedComp, |
Called when the collision capsule touches another primitive component | |
| bool | CheckFall
(
const FFindFloorResult& OldFloor, |
Check if pawn is falling | |
| bool | CheckLedgeDirection
(
const FVector& OldLocation, |
Returns true if there is a suitable floor SideStep from current position. | |
| bool | CheckWaterJump
(
FVector CheckPoint, |
Check if swimming pawn just ran into edge of the pool and should jump out. | |
| void | Clears forces accumulated through AddImpulse() and AddForce(), and also pending launch velocity. | ||
| 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 | |
| void | ClientAdjustPosition_Implementation
(
float TimeStamp, |
Replicate position correction to client, associated with a timestamped servermove. | |
| void | ClientAdjustRootMotionPosition_Implementation
(
float TimeStamp, |
Replicate position correction to client when using root motion for movement. | |
| void | ClientAdjustRootMotionSourcePosition_Implementation
(
float TimeStamp, |
Replicate root motion source correction to client when using root motion for movement. | |
| void | ClientHandleMoveResponse
(
const FCharacterMoveResponseDataContainer& MoveResponse |
On the client, handles the move response from the server after it has been received and unpacked in MoveResponsePacked_ClientReceive. | |
| bool | If bUpdatePosition is true, then replay any unacked moves. | ||
| void | ClientVeryShortAdjustPosition_Implementation
(
float TimeStamp, |
Bandwidth saving version, when velocity is zeroed | |
| float | Computes the analog input modifier based on current input vector and/or acceleration. | ||
| void | ComputeFloorDist
(
const FVector& CapsuleLocation, |
Compute distance to the floor from bottom sphere of capsule and store the result in OutFloorResult. | |
| FVector | ComputeGroundMovementDelta
(
const FVector& Delta, |
Compute a vector of movement, given a delta and a hit result of the surface we are on. | |
| FRotator | ComputeOrientToMovementRotation
(
const FRotator& CurrentRotation, |
Compute a target rotation based on current movement. | |
| bool | ComputePerchResult
(
const float TestRadius, |
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. | |
| FVector | ConstrainAnimRootMotionVelocity
(
const FVector& RootMotionVelocity, |
Constrain components of root motion velocity that may not be appropriate given the current movement mode (e.g. when falling Z may be ignored). | |
| FVector | ConstrainInputAcceleration
(
const FVector& InputAcceleration |
Enforce constraints on input given current state. | |
| void | ControlledCharacterMove
(
const FVector& InputVector, |
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. | |
| FTransform | ConvertLocalRootMotionToWorld
(
const FTransform& InLocalRootMotion, |
Takes component space root motion and converts it to world space. | |
| void | ConvertRootMotionServerIDsToLocalIDs
(
const FRootMotionSourceGroup& LocalRootMotionToMatchWith, |
Converts received server IDs in a root motion group to local IDs | |
| void | Crouch
(
bool bClientSimulation |
Checks if new capsule size fits (no encroachment), and call CharacterOwner->OnStartCrouch() if successful. | |
| void | DecayFormerBaseVelocity
(
float deltaTime |
Reduces former base velocity according to FormerBaseVelocityDecayHalfLife | |
DEPRECATED_CHARACTER_MOVEMENT_RPC
(
ClientAdjustRootMotionSourcePosition, |
Replicate root motion source correction to client when using root motion for movement. | ||
DEPRECATED_CHARACTER_MOVEMENT_RPC
(
ClientAdjustRootMotionPosition, |
Replicate position correction to client when using root motion for movement. | ||
DEPRECATED_CHARACTER_MOVEMENT_RPC
(
ClientVeryShortAdjustPosition, |
Bandwidth saving version, when velocity is zeroed | ||
DEPRECATED_CHARACTER_MOVEMENT_RPC
(
ClientAdjustPosition, |
Replicate position correction to client, associated with a timestamped servermove. | ||
DEPRECATED_CHARACTER_MOVEMENT_RPC
(
ClientAckGoodMove, |
If no client adjustment is needed after processing received ServerMove(), ack the good move so client can remove it from SavedMoves | ||
DEPRECATED_CHARACTER_MOVEMENT_RPC
(
ServerMoveDualHybridRootMotion_Implementation, |
|||
DEPRECATED_CHARACTER_MOVEMENT_RPC
(
ServerMoveOld, |
Resending an (important) old move. Process it if not already processed. | ||
DEPRECATED_CHARACTER_MOVEMENT_RPC
(
CallServerMove, |
Call the appropriate replicated ServerMove() function to send a client player move to the server. | ||
DEPRECATED_CHARACTER_MOVEMENT_RPC
(
ServerMoveDualHybridRootMotion, |
Replicated function sent by client to server - contains client movement and view info for two moves. | ||
DEPRECATED_CHARACTER_MOVEMENT_RPC
(
ServerMoveDual_Implementation, |
|||
DEPRECATED_CHARACTER_MOVEMENT_RPC
(
ServerMoveDual, |
Replicated function sent by client to server - contains client movement and view info for two moves. | ||
DEPRECATED_CHARACTER_MOVEMENT_RPC
(
ServerMoveOld_Implementation, |
|||
DEPRECATED_CHARACTER_MOVEMENT_RPC
(
ServerMove_Implementation, |
|||
DEPRECATED_CHARACTER_MOVEMENT_RPC
(
ServerMove, |
BEGIN DEPRECATED movement RPCs. Use the Packed versions above instead. | ||
| void | Make movement impossible (sets movement mode to MOVE_None). | ||
| void | DisplayDebug
(
UCanvas* Canvas, |
Draw important variables on canvas. | |
| bool | DoJump
(
bool bReplayingMoves, |
Perform jump. | |
| void | FillAsyncInput
(
const FVector& InputVector, |
Prepare inputs for asynchronous simulation on physics thread | |
| void | FindBestNavMeshLocation
(
const FVector& TraceStart, |
Performs trace for ProjectLocationFromNavMesh | |
| void | FindFloor
(
const FVector& CapsuleLocation, |
Sweeps a vertical trace to find the floor for the capsule at the given location. | |
| bool | FindNavFloor
(
const FVector& TestLocation, |
Project a location to navmesh to find adjusted height. | |
| FVector | FindWaterLine
(
FVector Start, |
Get as close to waterline as possible, staying on same side as currently. | |
| bool | FloorSweepTest
(
FHitResult& OutHit, |
Sweep against the world and return the first blocking hit. | |
| void | |||
| void | Force a client adjustment. Resets ServerLastClientAdjustmentTime. | ||
| void | Force a client update by making it appear on the server that the client hasn't updated in a long time. | ||
| FVector | GetAirControl
(
float DeltaTime, |
Get the air control to use during falling movement. | |
| float | 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. | ||
| FVector | GetBestDirectionOffActor
(
AActor* BaseActor |
Can be overridden to choose to jump based on character velocity, base actor dimensions, etc. | |
| ACharacter * | Get the Character that owns UpdatedComponent. | ||
| float | GetClientNetSendDeltaTime
(
const APlayerController* PC, |
Determine minimum delay between sending client updates to the server. | |
| float | Returns the collision half-height when crouching (component scale is applied separately) | ||
| FVector | Returns current acceleration, computed from input vector each update. | ||
| FCharacterNetworkMoveData * | Current move data being processed or handled. | ||
| const FSavedMove_Character * | Gets the SavedMove being replayed on the client after a correction is received. | ||
| FRotator | GetDeltaRotation
(
float DeltaTime |
Returns how far to rotate character during the time interval DeltaTime. | |
| FVector | GetFallingLateralAcceleration
(
float DeltaTime |
Get the lateral acceleration to use during falling movement. | |
| FVector | Returns the current gravity direction. | ||
| FVector | GetGravitySpaceComponentZ
(
const FVector& Vector |
Returns the component of the vector in the gravity-space vertical direction. | |
| FVector::FReal | GetGravitySpaceZ
(
const FVector& Vector |
Returns the size of a vector in the gravity-space vertical direction. | |
| FQuat | Returns a quaternion transforming from gravity to world space. | ||
| EMovementMode | Get current GroundMovementMode value. | ||
| FVector | If we have a movement base, get the velocity that should be imparted by that base, usually when jumping off of it. | ||
| UPrimitiveComponent * | Accessor to the Last Server Movement Base, only relevant during server update | ||
| FVector | Returns the location at the end of the last tick. | ||
| FQuat | Returns the rotation Quat at the end of the last tick. | ||
| FVector | Returns velocity requested by path following | ||
| FRotator | Returns the rotation at the end of the last tick. | ||
| FVector | Returns the velocity at the end of the last tick. | ||
| FVector | GetLedgeMove
(
const FVector& OldLocation, |
||
| float | Returns maximum acceleration for the current state. | ||
| float | Returns maximum deceleration for the current state when braking (ie when there is no acceleration). | ||
| float | Compute the max jump height based on the JumpZVelocity velocity and gravity. | ||
| float | Compute the max jump height based on the JumpZVelocity velocity and gravity. | ||
| float | Returns maximum acceleration for the current state. | ||
| UPrimitiveComponent * | Return PrimitiveComponent we are based on (standing and walking on). | ||
| FString | Returns MovementMode string | ||
| FCharacterMoveResponseDataContainer & | Get the struct used for server response RPC serialization. | ||
| const INavigationDataInterface * | GetNavData () |
Get Navigation data for the Character. Returns null if there is no associated nav data. | |
| FCharacterNetworkMoveDataContainer & | Get the struct used for client to server move RPC serialization. | ||
| float | Generate a random angle in degrees that is approximately equal between client and server. | ||
| FCollisionShape | GetPawnCapsuleCollisionShape
(
const EShrinkCapsuleExtent ShrinkMode, |
Get the collision shape for the Pawn owner, possibly reduced in size depending on ShrinkMode. | |
| FVector | GetPawnCapsuleExtent
(
const EShrinkCapsuleExtent ShrinkMode, |
Get the capsule extent for the Pawn owner, possibly reduced in size depending on ShrinkMode. | |
| float | 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. | ||
| FNetworkPredictionData_Client_Character * | |||
| FNetworkPredictionData_Server_Character * | |||
| TSharedPtr< FRootMotionSource > | GetRootMotionSource
(
FName InstanceName |
Get a RootMotionSource from current root motion by name | |
| TSharedPtr< FRootMotionSource > | GetRootMotionSourceByID
(
uint16 RootMotionSourceID |
Get a RootMotionSource from current root motion by ID | |
| int32 | END IRVOAvoidanceInterface a shortcut function to be called instead of GetRVOAvoidanceUID when callee knows it's dealing with a char movement comp | ||
| float | Get the value of ServerLastTransformUpdateTimeStamp. | ||
| float | GetSimulationTimeStep
(
float RemainingTime, |
Compute remaining time step given remaining time and current iterations. | |
| ETeleportType | When moving the character, we should inform physics as to whether we are teleporting. | ||
| float | Returns the radius within which we can stand on the edge of a surface without falling (if this is a walkable surface). | ||
| float | Get the max angle in degrees of a walkable surface for the character. | ||
| float | Get the Z component of the normal of the steepest walkable surface for the character. | ||
| FQuat | Returns a quaternion transforming from world to gravity space. | ||
| bool | Handle a pending launch during an update. Returns true if the launch was triggered. | ||
| FVector | HandleSlopeBoosting
(
const FVector& SlideResult, |
Limit the slide vector when falling if the resulting slide might boost the character faster upwards. | |
| void | HandleSwimmingWallHit
(
const FHitResult& Hit, |
Allow custom handling when character hits a wall while swimming. | |
| void | HandleWalkingOffLedge
(
const FVector& PreviousFloorImpactNormal, |
Trigger OnWalkingOffLedge event on CharacterOwner. | |
| bool | Returns true if we have Root Motion from animation to use in PerformMovement() physics. | ||
| bool | Whether the gravity direction is different from UCharacterMovementComponent::DefaultGravityDirection. | ||
| bool | Returns true if we have Root Motion from any source to use in PerformMovement() physics. | ||
| bool | HasValidData () |
Return true if we have a valid CharacterOwner and UpdatedComponent. | |
| float | Determine how deep in water the character is immersed. | ||
| bool | |||
| bool | IsClientTimeStampValid
(
float TimeStamp, |
Internal const check for client timestamp validity without side-effects. | |
| bool | Returns true if currently performing a movement update. | ||
| bool | IsValidLandingSpot
(
const FVector& CapsuleLocation, |
Verify that the supplied hit result is a valid landing spot when falling. | |
| bool | IsWalkable
(
const FHitResult& Hit |
Return true if the hit result should be considered a walkable surface for the character. | |
| bool | IsWalking () |
Returns true if the character is in the 'Walking' movement mode. | |
| bool | IsWithinEdgeTolerance
(
const FVector& CapsuleLocation, |
Return true if the 2D distance to the impact point is inside the edge tolerance (CapsuleRadius minus a small rejection threshold). | |
| void | Force this pawn to bounce off its current base, which isn't an acceptable base for it. | ||
| void | JumpOutOfWater
(
FVector WallNormal |
Jump onto shore from water | |
| void | K2_ComputeFloorDist
(
FVector CapsuleLocation, |
Compute distance to the floor from bottom sphere of capsule and store the result in FloorResult. | |
| void | K2_FindFloor
(
FVector CapsuleLocation, |
Sweeps a vertical trace to find the floor for the capsule at the given location. | |
| float | Get the max angle in degrees of a walkable surface for the character. | ||
| float | Get the Z component of the normal of the steepest walkable surface for the character. | ||
| void | Queue a pending launch with velocity LaunchVel. | ||
| FVector | LimitAirControl
(
float DeltaTime, |
Limits the air control to use during falling movement, given an impact while falling. | |
| void | Adjusts velocity when walking so that Z velocity is zero. | ||
| void | Call SaveBaseLocation() if not deferring updates (bDeferUpdateBasedMovement is false). | ||
| void | MaybeUpdateBasedMovement
(
float DeltaSeconds |
Update or defer updating of position based on Base movement | |
| void | MoveAlongFloor
(
const FVector& InVelocity, |
Move along the floor, using CurrentFloor and ComputeGroundMovementDelta() to get a movement direction. | |
| void | MoveAutonomous
(
float ClientTimeStamp, |
Process a move at the given time stamp, given the compressed flags representing various events that occurred (ie jump). | |
| void | MoveResponsePacked_ClientReceive
(
const FCharacterMoveResponsePackedBits& PackedBits |
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(). | |
| void | MoveResponsePacked_ServerSend
(
const FCharacterMoveResponsePackedBits& PackedBits |
Sends a move response from the server to the client (through character to avoid component RPC overhead), eventually calling MoveResponsePacked_ClientReceive() on the client. | |
| void | MoveSmooth
(
const FVector& InVelocity, |
Moves along the given movement direction using simple movement rules based on the current movement mode (usually used by simulated proxies). | |
| FVector | NewFallVelocity
(
const FVector& InitialVelocity, |
Compute new falling velocity from given velocity and gravity. | |
| void | Called if bNotifyApex is true and character has just passed the apex of its jump. | ||
| void | OnCharacterStuckInGeometry
(
const FHitResult* Hit |
Notification that the character is stuck in geometry. Only called during walking movement. | |
| void | OnClientCorrectionReceived
(
FNetworkPredictionData_Client_Character& ClientData, |
END DEPRECATED movement RPCs. | |
| void | Called by UCharacterMovementComponent::VerifyClientTimeStamp() when a client timestamp reset has been detected and is valid. | ||
| void | OnMovementModeChanged
(
EMovementMode PreviousMovementMode, |
Called after MovementMode has changed. | |
| void | OnMovementUpdated
(
float DeltaSeconds, |
Event triggered at the end of a movement update. | |
| void | OnRootMotionSourceBeingApplied
(
const FRootMotionSource* Source |
Called during ApplyRootMotionSource call, useful for project-specific alerts for "something is about to be altering our movement" | |
| void | OnTimeDiscrepancyDetected
(
float CurrentTimeDiscrepancy, |
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) | |
| void | OnUnableToFollowBaseMove
(
const FVector& DeltaPosition, |
Event triggered when we are moving on a base but we are not able to move the full DeltaPosition because something has blocked us. | |
| uint8 | |||
| uint32 | PackYawAndPitchTo32
(
const float Yaw, |
||
| void | PerformAirControlForPathFollowing
(
FVector Direction, |
If ShouldPerformAirControlForPathFollowing() returns true, it will update Velocity and Acceleration to air control in the desired Direction for character using path following. | |
| void | PerformMovement
(
float DeltaTime |
Movement functions broken out based on owner's network Role. | |
| void | PhysCustom
(
float deltaTime, |
Movement update functions should only be called through StartNewPhysics() | |
| void | PhysFalling
(
float deltaTime, |
Handle falling movement. | |
| void | PhysFlying
(
float deltaTime, |
Movement update functions should only be called through StartNewPhysics() | |
| void | PhysicsRotation
(
float DeltaTime |
Perform rotation over deltaTime | |
| void | PhysNavWalking
(
float deltaTime, |
Movement update functions should only be called through StartNewPhysics() | |
| void | PhysSwimming
(
float deltaTime, |
Movement update functions should only be called through StartNewPhysics() | |
| void | PhysWalking
(
float deltaTime, |
Movement update functions should only be called through StartNewPhysics() | |
| void | |||
| void | PostPhysicsTickComponent
(
float DeltaTime, |
Tick function called after physics (sync scene) has finished simulation, before cloth | |
| void | PostProcessAvoidanceVelocity
(
FVector& NewVelocity |
Allows modifing avoidance velocity, called when bUseRVOPostProcess is set | |
| void | PrePhysicsTickComponent
(
float DeltaTime, |
Tick function called before physics | |
| void | |||
| void | ProcessClientTimeStampForTimeDiscrepancy
(
float ClientTimeStamp, |
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. | |
| void | ProcessLanded
(
const FHitResult& Hit, |
Handle landing against Hit surface over remaingTime and iterations, calling SetPostLandedPhysics() and starting the new movement mode. | |
| FVector | ProjectLocationFromNavMesh
(
float DeltaSeconds, |
Attempts to better align navmesh walking characters with underlying geometry (sometimes navmesh can differ quite significantly from geometry). | |
| FVector | ProjectToGravityFloor
(
const FVector& Vector |
Project a vector onto the floor defined by the gravity direction. | |
| void | Register async callback with physics system. | ||
| void | RemoveRootMotionSource
(
FName InstanceName |
Remove a RootMotionSource from current root motion by name | |
| void | RemoveRootMotionSourceByID
(
uint16 RootMotionSourceID |
Remove a RootMotionSource from current root motion by ID | |
| void | ReplicateMoveToServer
(
float DeltaTime, |
Here's how player movement prediction, replication and correction works in network games: | |
| void | Restores Velocity to LastPreAdditiveVelocity during Root Motion Phys*() function calls | ||
| void | RevertMove
(
const FVector& OldLocation, |
Revert to previous position OldLocation, return to being based on OldBase. | |
| FVector | RotateGravityToWorld
(
const FVector& World |
Rotate a vector from world to gravity space. | |
| FVector | RotateWorldToGravity
(
const FVector& Gravity |
Rotate a vector from gravity to world space. | |
| FVector | RoundAcceleration
(
FVector InAccel |
Round acceleration, for better consistency and lower bandwidth in networked games. | |
| void | Update OldBaseLocation and OldBaseQuat if there is a valid movement base, and store the relative location/rotation if necessary. | ||
| FVector | ScaleInputAcceleration
(
const FVector& InputAcceleration |
Scale input acceleration, based on movement acceleration rate. | |
| void | ServerAutonomousProxyTick
(
float DeltaSeconds |
Special Tick to allow custom server-side functionality on Autonomous Proxies. | |
| bool | ServerCheckClientError
(
float ClientTimeStamp, |
Check for Server-Client disagreement in position or other movement state important enough to trigger a client correction. | |
| bool | ServerExceedsAllowablePositionError
(
float ClientTimeStamp, |
Check position error within ServerCheckClientError(). | |
| void | ServerMove_HandleMoveData
(
const FCharacterNetworkMoveDataContainer& MoveDataContainer |
Handle movement data after it's unpacked from the ServerMovePacked_ServerReceive() call. | |
| void | ServerMove_PerformMovement
(
const FCharacterNetworkMoveData& MoveData |
Check timestamps, generate a delta time, and pass through movement params to MoveAutonomous. | |
| bool | ServerMove_Validate
(
float TimeStamp, |
||
| bool | ServerMoveDual_Validate
(
float TimeStamp0, |
||
| bool | ServerMoveDualHybridRootMotion_Validate
(
float TimeStamp0, |
||
| void | ServerMoveHandleClientError
(
float ClientTimeStamp, |
Have the server check if the client is outside an error tolerance, and queue a client adjustment if so. | |
| bool | ServerMoveOld_Validate
(
float OldTimeStamp, |
||
| void | ServerMovePacked_ClientSend
(
const FCharacterServerMovePackedBits& PackedBits |
The actual network RPCs for character movement are passed to ACharacter, which wrap to the _Implementation call here, to avoid Component RPC overhead. | |
| void | ServerMovePacked_ServerReceive
(
const FCharacterServerMovePackedBits& PackedBits |
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(). | |
| void | ServerSendMoveResponse
(
const FClientAdjustment& PendingAdjustment |
On the server, sends a packed move response to the client. | |
| bool | ServerShouldUseAuthoritativePosition
(
float ClientTimeStamp, |
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. | |
| void | SetAvoidanceEnabled
(
bool bEnable |
Change avoidance state and registers in RVO manager if needed | |
| void | SetAvoidanceGroup
(
int32 GroupFlags |
||
| void | SetAvoidanceGroupMask
(
const FNavAvoidanceMask& GroupMask |
||
| void | SetAvoidanceVelocityLock
(
UAvoidanceManager* Avoidance, |
Lock avoidance velocity | |
| void | SetBase
(
UPrimitiveComponent* NewBase, |
Update the base of the character, which is the PrimitiveComponent we are standing on. | |
| void | SetBaseFromFloor
(
const FFindFloorResult& FloorResult |
Update the base of the character, using the given floor result if it is walkable, or null if not. | |
| void | SetCrouchedHalfHeight
(
const float NewValue |
Sets collision half-height when crouching and updates dependent computations | |
| void | SetCurrentNetworkMoveData
(
FCharacterNetworkMoveData* CurrentData |
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. | |
| void | SetCurrentReplayedSavedMove
(
FSavedMove_Character* SavedMove |
Used internally to save the SavedMove currently being replayed on the client so it is accessible to any functions that might need it. | |
| void | Set movement mode to the default based on the current physics volume. | ||
| void | SetGravityDirection
(
const FVector& GravityDir |
Set a custom, local gravity direction to use during movement simulation. | |
| void | SetGravitySpaceZ
(
FVector& Vector, |
Set the vertical component of the vector to the given value in the gravity-space vertical direction. | |
| void | SetGroundMovementMode
(
EMovementMode NewGroundMovementMode |
Set movement mode to use when returning to walking movement (either MOVE_Walking or MOVE_NavWalking). | |
| void | SetGroupsToAvoid
(
int32 GroupFlags |
||
| void | SetGroupsToAvoidMask
(
const FNavAvoidanceMask& GroupMask |
||
| void | SetGroupsToIgnore
(
int32 GroupFlags |
||
| void | SetGroupsToIgnoreMask
(
const FNavAvoidanceMask& GroupMask |
||
| void | SetMovementMode
(
EMovementMode NewMovementMode, |
Change movement mode. | |
| void | SetMoveResponseDataContainer
(
FCharacterMoveResponseDataContainer& PersistentDataStorage |
Set custom struct used for server response RPC serialization. | |
| void | SetNavWalkingPhysics
(
bool bEnable |
Switch collision settings for NavWalking mode (ignore world collisions) | |
| void | SetNetworkMoveDataContainer
(
FCharacterNetworkMoveDataContainer& PersistentDataStorage |
Set custom struct used for client to server move RPC serialization. | |
| void | SetPostLandedPhysics
(
const FHitResult& Hit |
Use new physics after landing. Defaults to swimming if in water, walking otherwise. | |
| void | SetWalkableFloorAngle
(
float InWalkableFloorAngle |
Set the max angle in degrees of a walkable surface for the character. Also computes WalkableFloorZ. | |
| void | SetWalkableFloorZ
(
float InWalkableFloorZ |
Set the Z component of the normal of the steepest walkable surface for the character. | |
| bool | 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. | ||
| bool | ShouldCatchAir
(
const FFindFloorResult& OldFloor, |
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). | |
| bool | ShouldCheckForValidLandingSpot
(
float DeltaTime, |
Determine whether we should try to find a valid landing spot after an impact with an invalid one (based on the Hit result). | |
| 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). | |
| bool | ShouldComputePerchResult
(
const FHitResult& InHit, |
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. | |
| bool | Returns if the character rotation should be corrected on clients when sending a server move response correction. | ||
| bool | ShouldJumpOutOfWater
(
FVector& JumpDir |
Determine whether the Character should jump when exiting water. | |
| bool | ShouldLimitAirControl
(
float DeltaTime, |
Returns true if falling movement should limit air control. | |
| bool | 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. | ||
| bool | If true, DesiredRotation will be restricted to only Yaw component in PhysicsRotation() | ||
| bool | Determines whether to use packed movement RPCs with variable length payloads, or legacy code which has multiple functions required for different situations. | ||
| void | SimulatedTick
(
float DeltaSeconds |
Special Tick for Simulated Proxies | |
| void | SimulateMovement
(
float DeltaTime |
Simulate movement on a non-owning client. | |
| void | SimulateRootMotion
(
float DeltaSeconds, |
Simulate Root Motion physics on Simulated Proxies | |
| void | SmoothClientPosition
(
float DeltaSeconds |
Smooth mesh location for network interpolation, based on values set up by SmoothCorrection. | |
| void | SmoothClientPosition_Interpolate
(
float DeltaSeconds |
Update interpolation values for client smoothing. | |
| void | Update mesh location based on interpolated values. | ||
| void | StartFalling
(
int32 Iterations, |
Transition from walking to falling | |
| void | StartNewPhysics
(
float deltaTime, |
Changes physics based on MovementMode | |
| void | StartSwimming
(
FVector OldLocation, |
Handle start swimming functionality | |
| bool | StepUp
(
const FVector& GravDir, |
Move up steps or slope. Does nothing and returns false if CanStepUp(Hit) returns false. | |
| float | Swim
(
FVector Delta, |
Swimming uses gravity - but scaled by (1.f - buoyancy) | |
| void | TickCharacterPose
(
float DeltaTime |
Ticks the characters pose and accumulates root motion | |
| bool | Checks to see if the current location is not encroaching blocking geometry so the character can leave NavWalking. | ||
| NOTE: THIS FUNCTION IS DEPRECATED, PLEASE CALL DoJump(bool bReplayingMoves, float DeltaTime) ... | |||
|
Collision half-height when crouching (component scale is applied separately) | ||
| void | UnCrouch
(
bool bClientSimulation |
Checks if default capsule size fits (no encroachment), and trigger OnEndCrouch() on the owner if successful. | |
| void | UnpackNetworkMovementMode
(
const uint8 ReceivedMode, |
||
| void | UpdateBasedMovement
(
float DeltaSeconds |
Update position based on Base movement | |
| void | UpdateBasedRotation
(
FRotator& FinalRotation, |
Update controller's view rotation as pawn's base rotates | |
| void | UpdateCharacterStateAfterMovement
(
float DeltaSeconds |
Update the character state in PerformMovement after the position change. | |
| void | UpdateCharacterStateBeforeMovement
(
float DeltaSeconds |
Update the character state in PerformMovement right before doing the actual position change | |
| void | Called in Tick to update data in RVO avoidance manager | ||
| void | React to instantaneous change in position. | ||
| void | UpdateFromCompressedFlags
(
uint8 Flags |
Unpack compressed flags from a saved move and set state accordingly. | |
| void | Used during SimulateMovement for proxies, this computes a new value for Acceleration before running proxy simulation. | ||
| bool | VerifyClientTimeStamp
(
float TimeStamp, |
On the Server, verify that an incoming client TimeStamp is valid and has not yet expired. | |
| float | Draw in-world debug information for character movement (called with p.VisualizeMovement > 0). |
Overridden from UPawnMovementComponent
| Type | Name | Description | |
|---|---|---|---|
| void | NotifyBumpedPawn
(
APawn* BumpedPawn |
Notify of collision in case we want to react, such as waking up avoidance or pathing code. |
Overridden from UNavMovementComponent
| Type | Name | Description | |
|---|---|---|---|
| FVector | Returns location of controlled actor's "feet" meaning center of bottom of collision bounding box |
Overridden from UMovementComponent
| Type | Name | Description | |
|---|---|---|---|
| void | AddRadialForce
(
const FVector& Origin, |
Adds force from radial force components. | |
| void | AddRadialImpulse
(
const FVector& Origin, |
Adds impulse from radial force components. | |
| FVector | ComputeSlideVector
(
const FVector& Delta, |
Calculate slide vector along a surface. | |
| float | GetGravityZ () |
Returns gravity that affects this component | |
| float | GetMaxSpeed () |
Returns maximum speed of component in current movement mode. | |
| FVector | GetPenetrationAdjustment
(
const FHitResult& Hit |
Overridden to enforce max distances based on hit geometry. | |
| void | HandleImpact
(
const FHitResult& Hit, |
Handle a blocking impact. | |
| void | OnTeleported () |
Called by owning Character upon successful teleport from AActor::TeleportTo(). | |
| void | PhysicsVolumeChanged
(
APhysicsVolume* NewVolume |
Delegate when PhysicsVolume of UpdatedComponent has been changed | |
| bool | ResolvePenetrationImpl
(
const FVector& Adjustment, |
Overridden to set bJustTeleported to true, so we don't make incorrect velocity calculations based on adjusted movement. | |
| void | SetUpdatedComponent
(
USceneComponent* NewUpdatedComponent |
Overridden to only allow registration with components owned by a Pawn. | |
| float | SlideAlongSurface
(
const FVector& Delta, |
Custom version of SlideAlongSurface that handles different movement modes separately; namely during walking physics we might not want to slide up slopes. | |
| void | TwoWallAdjust
(
FVector& WorldSpaceDelta, |
Custom version that allows upwards slides when walking if the surface is walkable. |
Overridden from UActorComponent
| Type | Name | Description | |
|---|---|---|---|
| void | ApplyWorldOffset
(
const FVector& InOffset, |
Called by owner actor on position shifting Component should update all relevant data structures to reflect new actor location | |
| void | BeginPlay () |
Begins Play for the component. | |
| void | Deactivate () |
Deactivates the SceneComponent. | |
| void | OnRegister () |
Overridden to update component properties that should be updated while being edited. | |
| void | RegisterComponentTickFunctions
(
bool bRegister |
Virtual call chain to register all tick functions | |
| void | TickComponent
(
float DeltaTime, |
Function called every frame on this ActorComponent. |
Overridden from UObject
| Type | Name | Description | |
|---|---|---|---|
| void | BeginDestroy () |
Called before destroying the object. | |
| void | PostEditChangeProperty
(
FPropertyChangedEvent& PropertyChangedEvent |
Called when a property on this object has been modified externally | |
| void | PostLoad () |
Do any object-specific cleanup required immediately after loading an object. | |
| void | Handles reading, writing, and reference collecting using FArchive. |
Overridden from INavMovementInterface
| Type | Name | Description | |
|---|---|---|---|
| bool | Returns true if path following can start | ||
| bool | Check if current move target can be reached right now if positions are matching (e.g. performing scripted move and can't stop) | ||
| float | GetPathFollowingBrakingDistance
(
float MaxSpeed |
Returns braking distance for acceleration driven path following | |
| bool | IsCrouching () |
Returns true if currently crouching | |
| bool | IsFalling () |
Returns true if currently falling (not flying, in a non-fluid volume, and not on the ground) | |
| bool | IsFlying () |
Returns true if currently flying (moving through a non-fluid volume without resting on the ground) | |
| bool | Returns true if currently moving on the ground (e.g. walking or driving) | ||
| bool | IsSwimming () |
Returns true if currently swimming (moving through a fluid volume) | |
| void | RequestDirectMove
(
const FVector& MoveVelocity, |
Path following: request new velocity | |
| void | RequestPathMove
(
const FVector& MoveInput |
UNavMovementComponent override for input operations. | |
| void | Begin: Functions to be implemented here for shared functionality. |
Overridden from IRVOAvoidanceInterface
| Type | Name | Description | |
|---|---|---|---|
| int32 | This actor's avoidance group mask | ||
| int32 | Agent groups to avoid mask | ||
| int32 | Agent groups to ignore | ||
| float | The scaled collider radius to consider for RVO avoidance | ||
| float | The scaled collider height to consider for RVO avoidance | ||
| FVector | Get the Location from where the RVO avoidance should originate | ||
| float | The scaled collider radius to consider for RVO avoidance | ||
| int32 | Return the AvoidanceUID assigned by the Avoidance Manager during registration | ||
| float | Returns the AvoidanceWeight assigned by the Avoidance Manager during registration | ||
| FVector | The velocity of the avoiding entity | ||
| void | SetAvoidanceGroupMask
(
int32 GroupFlags |
Store the avoidance group mask | |
| void | SetGroupsToAvoidMask
(
int32 GroupFlags |
Store the groups to avoid mask | |
| void | SetGroupsToIgnoreMask
(
int32 GroupFlags |
Store the groups to ignore mask | |
| void | SetRVOAvoidanceUID
(
int32 UID |
BEGIN IRVOAvoidanceInterface | |
| void | SetRVOAvoidanceWeight
(
float Weight |
Store the AvoidanceWeight generated by the Avoidance Manager |
Overridden from INetworkPredictionInterface
| Type | Name | Description | |
|---|---|---|---|
| bool | ForcePositionUpdate
(
float DeltaTime |
(Server) Trigger a position update on clients, if the server hasn't heard from them in a while. | |
| FNetworkPredictionData_Client * | Get prediction data for a client game. | ||
| FNetworkPredictionData_Server * | Get prediction data for a server game. | ||
| bool | Accessor to check if there is already client data, without potentially allocating it on demand. | ||
| bool | Accessor to check if there is already server data, without potentially allocating it on demand. | ||
| void | Resets client prediction data. | ||
| void | Resets server prediction data. | ||
| void | Server hook. | ||
| void | SmoothCorrection
(
const FVector& OldLocation, |
Client hook. |
Enums
| Type | Name | Description | |
|---|---|---|---|
| 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
| Type | Name | Description | |
|---|---|---|---|
| uint32: 1 | bForceBraking_DEPRECATED | Deprecated properties. | |
| float | CrouchedSpeedMultiplier_DEPRECATED | Multiplier to max ground speed to use when crouched | |
| float | UpperImpactNormalScale_DEPRECATED |
See Also
https://docs.unrealengine.com/latest/INT/Gameplay/Framework/Pawn/Character/