UCharacterMovementComponent::ClientAdjustPosition
Deprecated: ClientAdjustPosition() is deprecated, use ClientHandleMoveResponse() instead, or define SUPPORT_DEPRECATED_CHARACTER_MOVEMENT_RPCS=1 in the project and set CVar p.NetUsePackedMovementRPCs=0 to use the old code path.
#include "GameFramework/CharacterMovementComponent.h"
Access: public
Specifiers: virtualUFUNCTIONClientReliable
Description
Legacy client RPC the server calls to correct a client's position and velocity after detecting enough prediction error, triggering the client to replay pending moves from the corrected state.
Caveats & Gotchas
- • Deprecated since 4.26 in favor of the packed move-response path (ClientHandleMoveResponse); only compiled into an active code path with SUPPORT_DEPRECATED_CHARACTER_MOVEMENT_RPCS=1 and p.NetUsePackedMovementRPCs=0.
- • This is a stub that just forwards to ClientAdjustPosition_Implementation — the actual correction and replay logic lives there.
- • Fired by ServerMoveHandleClientError() on the server, not called directly; frequent corrections usually indicate a real desync (packet loss, physics divergence) rather than a bug in this function.
Signature
virtual void ClientAdjustPosition(float TimeStamp, FVector NewLoc, FVector NewVel, UPrimitiveComponent* NewBase, FName NewBaseBoneName, bool bHasBase, bool bBaseRelativePosition, uint8 ServerMovementMode) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| TimeStamp | float | Client timestamp of the move being corrected. | — |
| NewLoc | FVector | Authoritative server location. | — |
| NewVel | FVector | Authoritative server velocity. | — |
| NewBase | UPrimitiveComponent* | Server's movement base at the time of correction, if any. | — |
| NewBaseBoneName | FName | Bone name on the server's movement base, if a skeletal mesh. | — |
| bHasBase | bool | Whether the server considers the character based on something. | — |
| bBaseRelativePosition | bool | Whether NewLoc is relative to the base rather than world space. | — |
| ServerMovementMode | uint8 | Packed server movement mode to apply during the correction. | — |
Return Type
void Example
Legacy server-to-client correction RPC signature C++
// Sent by the server when the client's predicted position/velocity has drifted too far.
// Triggers ClientUpdatePositionAfterServerUpdate() to replay unacked moves on the client.
virtual void ClientAdjustPosition(float TimeStamp, FVector NewLoc, FVector NewVel,
UPrimitiveComponent* NewBase, FName NewBaseBoneName,
bool bHasBase, bool bBaseRelativePosition, uint8 ServerMovementMode); See Also
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | deprecated | Deprecated since 4.26 in favor of packed movement RPCs. |
Feedback
Was this helpful?