Unable to join the same room it seems?

So I followed a tutorial on using PUN, and got it working great. I then took that tutorial and imported it into a preexisting game, added pun and ran it. The SAME code in the preexisting game is not throwing errors, but when I join the same room with two clients, I can not see the player that is spawned.

Is there some setting, or some incompatibility that could be causing this? I am pretty stumped currently.

Comments

  • Hi @RacerDelux,

    please make sure, that both clients are actually in the same room. You can do this by using the Debug.Log function and print PhotonNetwork.CurrentRoom.ToStringFull(); to the console. You can also display the output of the function on the screen by adding it to Unity's OnGUI function. It would be also helpful, to take a look at the PlayerList. You can access it by using PhotonNetwork.PlayerList. Example:
    private void OnGUI()
    {
        GUILayout.BeginVertical();
    
        if (PhotonNetwork.InRoom)
        {
            GUILayout.Label(PhotonNetwork.CurrentRoom.ToStringFull());
    
            foreach (Player p in PhotonNetwork.PlayerList)
            {
                GUILayout.Label(p.ToStringFull());
            }
        }
    
        GUILayout.EndVertical();
    }
    If you use the Best Region feature, it might be possible, that the clients are connected to different regions. In this case, please try using a fixed region in the PhotonServerSettings and see, if this helps.
  • RacerDelux
    edited December 2018
    @Christian_Simon

    So I added this - I can confirm that the room names are the exact same.
    This is what it looks like:

    I just refreshed the import (once again, just plopping my tech demo into the existing project). Before I imported the tech demo, I tested and confirmed that the tech demo still works.
    ---------
    Update: I just tried removing every single file from the new project that was not related to the tech demo, ran it, still did not work.
  • Same problem here... it's like this all of the sudden.
  • RacerDelux
    edited December 2018
    So I have a bit of an update. This looks to be related with https://forum.photonengine.com/discussion/12341/connecting-to-master-server-works-in-build-but-not-editor#latest. I just tried running two clients, and they connected fine.

    It appears if your project is a collab project, uses google drive or a whole host of other issues, this could happen. I am going to try and apply the work around listed in the thread above and see if it works.
    ------ EDIT ---------
    The check for offline mode fix did not work it seems. This appears to be a VERY major bug, and needs to be fixed.
  • FRickReich
    edited December 2018
    I tried to copy the project out of my dropbox and it kind of worked but it killed the whole unity project too X:

    alas - what's the safest way to move a unity project completely to a different folder?
  • Export it via Assets -> Export Package. Make sure to highlight everything before.
  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @RacerDelux, @FRickReich,

    Thank you for choosing Photon!

    Make sure to go through our "Matchmaking Checklist".
    Especially "Best Region Considerations" and AppVersion points.
  • RacerDelux
    edited December 2018
    @JohnTube
    Thanks for the info. Upon setting the region manually it seemed to work as a temp fix.
    But I still do not understand why this issue occurred here, but did not occur in my other project?
    Why do projects that have unity collab seem to all of the sudden mess up?

    Also, if I don't set the region, I cannot connect properly while running from unity itself, but if I don't set the region and launch two compiled versions of the game, it works fine. It really feels like there is a bug here.

    I can confirm that from the editor I ALWAYS join US, but from a compiled client, I always join USW.
  • JohnTube
    JohnTube ✭✭✭✭✭
    edited December 2018
    Hi @RacerDelux,

    I don't think it's related to Unity Collab or anything else.
    According to the reports we have on the forum: Unity Editor and builds on the same machine, sometimes do not connect to the same region in the cases of US/USW and RU/RUE.
    This does not qualify as a bug.
  • @JohnTube
    Interesting. It does seem quite odd that it NEVER happens in some projects - like never, but ALWAYS happens in others.
  • Thank you so much, John! the region fixed it!