APlayerState::GetCompressedPing
#include "GameFramework/PlayerState.h"
Access: public
Specifiers: UFUNCTIONBlueprintGetter
Description
Returns the replicated compressed ping value, where the actual ping in milliseconds equals CompressedPing * 4. Use GetPingInMilliseconds for a more convenient millisecond value.
Caveats & Gotchas
- • The maximum representable ping is 255 * 4 = 1020 ms; players with higher latency will all report 255.
- • CompressedPing replication is gated by bShouldUpdateReplicatedPing — if the server has disabled that flag, this value will be stale or zero on remote clients for non-local player states.
Signature
uint8 GetCompressedPing() const Return Type
uint8 Example
Convert compressed ping to milliseconds manually C++
int32 PingMS = static_cast<int32>(PlayerState->GetCompressedPing()) * 4;
UE_LOG(LogGame, Log, TEXT("Player ping: %d ms"), PingMS); See Also
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?