Search Unity

UnityEngine.Ping on Android (Oculus Quest 2)

Discussion in 'Multiplayer' started by FabPollen, May 10, 2023.

  1. FabPollen

    FabPollen

    Joined:
    Jan 25, 2023
    Posts:
    9
    Hi,

    When I am using the UnityEngine.Ping from my Oculus Quest 2, it always return -1. Here's a toy example.
    Code (CSharp):
    1.  IEnumerator GetPing(string ip)
    2.   {
    3.         while (true)
    4.         {
    5.             Ping p = new Ping(ip);
    6.             yield return new WaitUntil(() => p.isDone);
    7.             Debug.Log("time " + p.time);
    8.         }
    9. }
    I just like to have a rough idea of the quality of the connection between my Oculus and an other computer.
    The code works fine with a Windows player.

    I have seen few post on this topic, it is not clear to me if Ping works with Android or not, or if there are permissions to grant.

    I'm using Unity 2020.3.47.

    Thanks for your help