ACharacter::ClientAdjustRootMotionSourcePosition
Deprecated: Use ClientMoveResponsePacked instead.
#include "GameFramework/Character.h"
Access: public
Specifiers: UFUNCTION
Description
Client RPC that corrects position and root-motion-source state when the server detects desync during source-driven (non-montage) root motion movement. Deprecated in favor of ClientMoveResponsePacked.
Caveats & Gotchas
- • Deprecated — the packed response RPC supersedes this for all new code. It remains present for backward compatibility with shipped titles using older movement component implementations.
- • FRootMotionSourceGroup is a replicated struct; its size varies with the number of active sources, which can make this RPC relatively large. The packed path compresses this more aggressively.
- • Sent unreliably; a missed packet means the client may remain desynced until the next correction is sent.
Signature
ENGINE_API void ClientAdjustRootMotionSourcePosition(float TimeStamp, FRootMotionSourceGroup ServerRootMotion, bool bHasAnimRootMotion, 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. | — |
| ServerRootMotion | FRootMotionSourceGroup | Replicated group of root motion sources from the server. | — |
| bHasAnimRootMotion | bool | Whether an animation root-motion montage is also active. | — |
| ServerMontageTrackPosition | float | Montage playback position if bHasAnimRootMotion is true. | — |
| ServerLoc | FVector | Corrected world location. | — |
| ServerRotation | FVector_NetQuantizeNormal | Corrected rotation packed as a normal vector. | — |
| ServerVelZ | float | Vertical velocity at the correction point. | — |
| ServerBase | UPrimitiveComponent* | Movement base component. | — |
| ServerBoneName | FName | Bone on the skeletal movement base, if any. | — |
| bHasBase | bool | Whether the character has a valid movement base. | — |
| bBaseRelativePosition | bool | Whether ServerLoc is base-relative. | — |
| ServerMovementMode | uint8 | Packed movement mode. | — |
Return Type
void Example
Override to log source corrections C++
void AMyCharacter::ClientAdjustRootMotionSourcePosition_Implementation(
float TimeStamp, FRootMotionSourceGroup ServerRM, bool bHasAnim,
float TrackPos, FVector Loc, FVector_NetQuantizeNormal Rot, float VelZ,
UPrimitiveComponent* Base, FName BoneName, bool bHasBase, bool bBaseRel, uint8 Mode)
{
UE_LOG(LogTemp, Verbose, TEXT("Source correction t=%f"), TimeStamp);
Super::ClientAdjustRootMotionSourcePosition_Implementation(
TimeStamp, ServerRM, bHasAnim, TrackPos, Loc, Rot, VelZ,
Base, BoneName, bHasBase, bBaseRel, Mode);
} See Also
Version History
Introduced in: 4.15
| Version | Status | Notes |
|---|---|---|
| 5.6 | deprecated | Superseded by ClientMoveResponsePacked. |
Feedback
Was this helpful?