Search Unity

How to add ping to a ranking box

Discussion in 'Scripting' started by marcin107, Dec 2, 2016.

  1. marcin107

    marcin107

    Joined:
    Aug 9, 2014
    Posts:
    5
    Hello guys!
    I'm having troubles with making a ping column in my ranking that means i don't know how to match player prefab with its NetworkConnection so i can get player's ping. Can you guys give me a hint or maybe even some short code example on how to do it?
     
  2. JC_SummitTech

    JC_SummitTech

    Joined:
    Nov 1, 2016
    Posts:
    78
    A ping is the time it takes to contact a server. You can just add a ping function to the server.
    Client notes the current time, sends ping. Receives pong asynchronously sometime later, check the time difference, and there is your ping.