LocalPlayer:GetNetworkPing() returns 0 even if IncomingReplicationLag is not 0.
Expected Behavior
GetNetworkPing should take into account the IncomingReplicationLag setting (e.g. if IncomingReplicationLag is set to 0.2 it should return twice that value, which is around 0.4)
Actual Behavior
GetNetworkPing always returns 0 regardless of IncomingReplicationLag’s value.
Workaround
Since IncomingReplicationLag cannot be accessed, there is no workaround short of hard-coding its value.
Issue Area: Engine Issue Type: Other Impact: Moderate Frequency: Constantly
At first, I thought that you could only get ping on the server, but it definitely is an error if it isn’t working on the local player. It even states you can on the documentation. It should work with IncomingReplicationLag as well since it only makes sense.
After doing tests, it apparently seems that it doesn’t work at all when testing it on Roblox. The ping will always return 0 on the client, even when getting it from the local player.
Hi, thanks for the report. Player:GetNetworkPing() does not take into account latency from the packet deserialization/processing pipeline in the engine, which is where IncomingReplicationLag is applied. The intention of this API is to measure the network latency between the client and the server, ignoring the engine-specific latency I mentioned earlier (deserialization/processing). So if you’re testing this locally in Studio, it’s not surprising the network ping is zero since the client and server are running on the same machine.
We don’t have a method that measures end-to-end latency, which sounds like what you’re looking for. Please file a feature request if you would like to see this implemented!