UCharacterMovementComponent::GetPredictionData_Server_Character
#include "GameFramework/CharacterMovementComponent.h"
Access: public
Description
Returns the concrete Character-specific server prediction data (last acknowledged move, force-update flags, error-checking state), allocating it on first use.
Caveats & Gotchas
- • This is the practical entry point for server-side move validation code — ServerMoveHandleClientError() and related overrides typically go through this instead of GetPredictionData_Server().
- • Only meaningful on the server; calling it on a client just allocates unused server bookkeeping.
- • bForceClientUpdate on the returned struct is one of the two conditions SendClientAdjustment() checks before sending a correction — setting it directly is a common way to force a correction outside of ForceClientAdjustment().
Signature
class FNetworkPredictionData_Server_Character* GetPredictionData_Server_Character() const Return Type
FNetworkPredictionData_Server_Character* Example
Forcing a correction via the server prediction data C++
FNetworkPredictionData_Server_Character* ServerData = GetCharacterMovement()->GetPredictionData_Server_Character();
if (ServerData)
{
ServerData->bForceClientUpdate = true;
} See Also
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?