UCharacterMovementComponent::GetPredictionData_Client
#include "GameFramework/CharacterMovementComponent.h"
Access: public
Specifiers: virtualoverride
Description
Returns the client-side movement prediction data, allocating it on first use. The result is guaranteed to be an FNetworkPredictionData_Client_Character instance.
Caveats & Gotchas
- • Should not be called unless running as a network client — it exists to satisfy INetworkPredictionInterface, but calling it on a dedicated server allocates client-only bookkeeping data for no reason.
- • Prefer GetPredictionData_Client_Character() when you already know you're in Character movement code — it returns the concrete type directly instead of the base FNetworkPredictionData_Client pointer.
- • The returned object is heap-allocated once and cached on ClientPredictionData; it isn't recreated every call.
Signature
virtual class FNetworkPredictionData_Client* GetPredictionData_Client() const override Return Type
FNetworkPredictionData_Client* Example
Accessing via the interface pointer C++
if (GetCharacterMovement()->HasPredictionData_Client())
{
FNetworkPredictionData_Client* PredictionData = GetCharacterMovement()->GetPredictionData_Client();
// Use PredictionData for interface-level bookkeeping.
} See Also
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?