UCharacterMovementComponent::GetPredictionData_Server
#include "GameFramework/CharacterMovementComponent.h"
Access: public
Specifiers: virtualoverride
Description
Returns the server-side movement prediction data, allocating it on first use. The result is guaranteed to be an FNetworkPredictionData_Server_Character instance.
Caveats & Gotchas
- • Should not be called unless running as a server — calling it on a client allocates server-only bookkeeping data that will never be used.
- • Prefer GetPredictionData_Server_Character() when you already know you're in Character movement code — it returns the concrete type directly instead of the base FNetworkPredictionData_Server pointer.
- • The returned object is heap-allocated once and cached on ServerPredictionData for the lifetime of the component.
Signature
virtual class FNetworkPredictionData_Server* GetPredictionData_Server() const override Return Type
FNetworkPredictionData_Server* Example
Accessing via the interface pointer C++
if (GetCharacterMovement()->HasPredictionData_Server())
{
FNetworkPredictionData_Server* PredictionData = GetCharacterMovement()->GetPredictionData_Server();
// Use PredictionData for interface-level bookkeeping.
} See Also
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?