UCharacterMovementComponent::ClientAdjustRootMotionPosition_Implementation
#include "GameFramework/CharacterMovementComponent.h"
Access: public
Specifiers: virtualENGINE_API
Description
Applies a position correction from the server while the client is driving movement from animation root motion, also resyncing the client's montage playback position to the server's.
Caveats & Gotchas
- • Only used while HasAnimRootMotion() is true on the client — a plain (non root motion) move uses ClientAdjustPosition_Implementation instead.
- • Resyncing ServerMontageTrackPosition can cause a visible pop if the client's local montage position had drifted significantly, since the anim instance jumps to match the server.
- • Like the other _Implementation corrections, this is invoked via ClientHandleMoveResponse and isn't meant to be called directly.
Signature
virtual void ClientAdjustRootMotionPosition_Implementation(float TimeStamp, float ServerMontageTrackPosition, FVector ServerLoc, FVector_NetQuantizeNormal ServerRotation, float ServerVelZ, UPrimitiveComponent* ServerBase, FName ServerBoneName, bool bHasBase, bool bBaseRelativePosition, uint8 ServerMovementMode) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| TimeStamp | float | Client move timestamp this correction responds to. | — |
| ServerMontageTrackPosition | float | Server's authoritative playback position in the active root motion montage. | — |
| ServerLoc | FVector | Corrected world location from the server. | — |
| ServerRotation | FVector_NetQuantizeNormal | Corrected rotation from the server, quantized as a normal vector. | — |
| ServerVelZ | float | Corrected vertical velocity from the server. | — |
| ServerBase | UPrimitiveComponent* | Movement base the server has the character standing on, if any. | — |
| ServerBoneName | FName | Bone name on ServerBase the character is attached to, if applicable. | — |
| bHasBase | bool | Whether ServerBase is valid. | — |
| bBaseRelativePosition | bool | Whether ServerLoc is relative to ServerBase rather than world space. | — |
| ServerMovementMode | uint8 | Packed movement mode the server had at the time of correction. | — |
Return Type
void Example
Root motion correction path C++
// Reached only when the corrected move was driven by anim root motion:
virtual void ClientAdjustRootMotionPosition_Implementation(float TimeStamp, float ServerMontageTrackPosition,
FVector ServerLoc, FVector_NetQuantizeNormal ServerRotation, float ServerVelZ,
UPrimitiveComponent* ServerBase, FName ServerBoneName, bool bHasBase,
bool bBaseRelativePosition, uint8 ServerMovementMode);
// Snaps location and resyncs the montage position before replaying subsequent moves. See Also
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?