Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Third Party [PUN2/Local/Quest2] Can only connect to a specific local server with Oculus Quest 2 VR headsets

Discussion in 'Multiplayer' started by PascalTheDog, Mar 17, 2022.

  1. PascalTheDog

    PascalTheDog

    Joined:
    Mar 16, 2015
    Posts:
    86
    A few months ago, I created a thread hoping to address an issue we were having connecting to a Photon local server (v5) with the Oculus Quest 2. Sadly, we weren't able to solve the problem at the time and we decided to set is aside for a while. Now we're back in business, and we tried proceeding by elimination in hope of identifying the issue once and for all.

    First of all, we installed a local server on a whole lot of additional machines — both desktops and laptops. We then tried to connect to those local servers not from the Oculus Quest 2 but directly from the Unity Editor on Windows — and guess what, it has no trouble connecting to every last server on our local network, creating or joining rooms, etc. So it doesn't seem like our issue is related to the machines themselves, our wiring or our modem.

    Going back to the Oculus Quest 2, we noticed that the first local server to which we successfully connected with a VR headset (which happens to have an IP address of 192.168.1.35) is the only one that continues properly operating as such. None of the other local servers will let us connect; not a single one but the one with a .35 address. As far as I know, all local server files are fresh installs with no difference in configuration. It's as if our venue had fallen victim to a curse except that one machine had been protected by a talisman.

    Bummer: we're stuck in a dead end again. But then I noticed something strange: When I join a room in the Editor, in which I have access to the logs, I get a notification specifying the IP address of the game server thanks to the Photon support logger. The first is what I get with the only machine that works with VR headsets; the second is what I get with all other machines.

    [1:56.56] SupportLogger OnJoinedRoom(Room: 'NetworkTesting' visible,open 1/4 players.). GameServer:192.168.1.35:5056

    [3.328] SupportLogger OnJoinedRoom(Room: 'NetworkTesting' visible,open 1/4 players.). GameServer:127.0.0.1:5056

    For some reason, only the 192.168.1.35 IP address is described explicitly; that of the local server that works fine with headsets. All the other as you can see above are described simply as localhost. This might be unrelated or irrelevant, but we couldn't help but notice the coincidence.

    We're kinda baffled and asssistance would be greatly appreciated. Cheers!
     
  2. MrPapayaMan

    MrPapayaMan

    Joined:
    Feb 16, 2021
    Posts:
    42
    Unless your deadest on Photon server, you can try DarkRift (free) or TNET which both provide server.exe that work locally or on the cloud. I’ve tested both with the Quest with success. With Darkrift you will have to script your own rooms and lobby’s. TNET has much of this functionality built in.

    Without source, the only people who are going to be able to assist you are the Photon guys.

    Maybe if you have an Android phone you can see what results you get. If it’s similar, going to guess it’s something within the clients #IF_UNITY_ANDROID defines. Not, much info to work with here. Even with more information, without source; everything is a guess.

    If they don’t have a solution for you. Best time to find an alternative library. Or write your own.
     
  3. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,079
    I'm sorry to read you're blocked by this issue for so long. Not great.

    If you want to host Photon yourself, you need to realize that the same configuration won't work on any two machines. This is because you have to define the IPs under which the Master Server and Game Servers should be reached. Different machines have different IPs.

    With an IP of 127.0.0.1 (the local machine) set for Master or Game Server, you tested that clients can connect to some of your server, then connect to the Photon instance running on the very same machine.

    The Quest (or any mobile for that matter) won't be able to give you the same illusion, as it doesn't run the Photon Server.

    Follow the doc about setting up the server IPs. When reporting connection issues, make clear if you don't connect at all (not even to a Name Server) and where you are stuck exactly. This helps us tremendously to help you.