UCharacterMovementComponent::ResetPredictionData_Client
#include "GameFramework/CharacterMovementComponent.h"
Access: public
Specifiers: virtualoverride
Description
Frees the allocated client-side movement prediction data (saved moves, pending move, smoothing state) and clears ClientPredictionData back to null.
Caveats & Gotchas
- • After calling this, HasPredictionData_Client() returns false again and the next GetPredictionData_Client_Character() call reallocates fresh data — any unacknowledged saved moves in flight are discarded.
- • There is a parallel ResetPredictionData_Server() for the server side; resetting one side does not reset the other.
- • Not commonly called directly in gameplay code — mainly relevant when tearing down or re-initializing prediction state, such as during possession changes.
Signature
virtual void ResetPredictionData_Client() override Return Type
void Example
Clearing stale prediction state after re-possession C++
void AMyCharacter::OnRep_Controller()
{
Super::OnRep_Controller();
if (IsLocallyControlled())
{
GetCharacterMovement()->ResetPredictionData_Client();
}
} See Also
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?