Unity Netcode for gameobjects with relay - calculate ping

Viewed 565

I am having trouble calculating the ping of players in Netcode. I have a list of lobbies, and I want to display the expected ping of each of them, before the client connects. Currently, I am using NetworkManager.Singleton.NetworkConfig.NetworkTransport.GetCurrentRtt(0); to calculate the ping. Is there a way to know the ping before connecting to the relay fully?

1 Answers

One option would be to run pings outside of the Network Managers

Microsoft has an example of their ping here

You could ping the host to show the ping before the player tries to connect.

Related