ACharacter::ClientAdjustRootMotionPosition
Deprecated: Use ClientMoveResponsePacked instead.
#include "GameFramework/Character.h"
Access: public
Specifiers: UFUNCTION
Description
Client RPC that corrects a simulated proxy's position and montage track when the server detects desync during animation root-motion movement. Deprecated in favor of ClientMoveResponsePacked.
Caveats & Gotchas
- • This RPC is deprecated — new projects should ensure CharacterMovementComponent uses the packed response path (ClientMoveResponsePacked) instead, which bundles all correction data into a single smaller RPC.
- • Sent unreliably; occasional packet loss means a correction may be missed without retransmission, relying on subsequent corrections to converge.
- • Do not call this manually — it is invoked by UCharacterMovementComponent on the server when a positional error exceeds the tolerance threshold.
Signature
ENGINE_API void ClientAdjustRootMotionPosition(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 | Server timestamp of the move being corrected. | — |
| ServerMontageTrackPosition | float | The authoritative montage playback position on the server. | — |
| ServerLoc | FVector | Corrected world location from the server. | — |
| ServerRotation | FVector_NetQuantizeNormal | Corrected rotation packed as a normal vector. | — |
| ServerVelZ | float | Vertical velocity component at the correction point. | — |
| ServerBase | UPrimitiveComponent* | Movement base component the character is standing on. | — |
| ServerBoneName | FName | Bone name on ServerBase if it is a skeletal mesh. | — |
| bHasBase | bool | Whether the character has a valid movement base. | — |
| bBaseRelativePosition | bool | Whether ServerLoc is relative to the base. | — |
| ServerMovementMode | uint8 | Packed movement mode from the server. | — |
Return Type
void Example
Observing the correction in a custom movement component C++
// Override in a subclass to log corrections for debugging
void AMyCharacter::ClientAdjustRootMotionPosition_Implementation(
float TimeStamp, float TrackPos, FVector Loc,
FVector_NetQuantizeNormal Rot, float VelZ,
UPrimitiveComponent* Base, FName BoneName,
bool bHasBase, bool bBaseRel, uint8 Mode)
{
UE_LOG(LogTemp, Verbose, TEXT("Root motion correction at t=%f"), TimeStamp);
Super::ClientAdjustRootMotionPosition_Implementation(
TimeStamp, TrackPos, Loc, Rot, VelZ, Base, BoneName, bHasBase, bBaseRel, Mode);
} See Also
Version History
Introduced in: 4.6
| Version | Status | Notes |
|---|---|---|
| 5.6 | deprecated | Superseded by ClientMoveResponsePacked. |
Feedback
Was this helpful?