Search Unity

UNet + GearVR

Discussion in 'UNet' started by Yapper, Aug 9, 2018.

  1. Yapper

    Yapper

    Joined:
    Jun 22, 2014
    Posts:
    2
    Hi Everyone,

    I'm working on a multiplayer VR game that uses GearVR. It runs on LAN, no matchmaking. It should keep the connection even if the headset is unmounted. The problem is that if I remove the headsets and leave them on the table for 5-10 minutes, they loose the connection. I tried the following:

    - turn "Run in background" on in the project settings
    - turn "Run in background" on in the Network Manager settings
    - set "Disconnect timeout" in the Network Manager settings to an extremely high value

    None of the above helps. Please let me know if you have any suggestion, or if the post fits better to the VR/XR topic. Thank you in advance.

    Jason
     
  2. aabramychev

    aabramychev

    Unity Technologies

    Joined:
    Jul 17, 2012
    Posts:
    574
    Let me guess, does android went to sleep mode during this time?
     
  3. Yapper

    Yapper

    Joined:
    Jun 22, 2014
    Posts:
    2
    It seems like, while the headset is unmounted, the screen goes black, I'm not sure what's happening in the background.
     
  4. aabramychev

    aabramychev

    Unity Technologies

    Joined:
    Jul 17, 2012
    Posts:
    574
    If screen goes black most probably device is going to sleep and therefore switch wifi off. AFAIK there is a callback which will notify you if device is gong to sleep (hence do not remember that name :( )
     
  5. aabramychev

    aabramychev

    Unity Technologies

    Joined:
    Jul 17, 2012
    Posts:
    574
    try Screen.sleepTimeout = SleepTimeout.NeverSleep?