Connecting to Master Server works in build but not editor.

Iv experience this issue several time once in unity 2018.1 and 2018.2.

the editor will work for a period of time then after maybe 2 - 3 hours working, it no longer connects to the master.

I then build the game and the built version works and is able to connect. any ideas or suggestions would be greatly appreciated.

Have tried.
- Fresh install
- Host
- New Project
- Different Versions of unity
- restarting router/Modem
- Restarting pc
- Restarting Unity


  • Jakeco19Jakeco19
    edited August 8
    //Connect To the master Server
        public void connectToPhoton()
            currentNetworkStatus = "Connecting";
            Debug.Log("Connecting To photon.....");
        //Was able to connect to the master Server
        private void OnConnectedToMaster()
            currentNetworkStatus = "Connected";
            Debug.Log("Connected To the master");
        //Was Disconnected from the master server
        private void OnDisconnectedFromPhoton()
            currentNetworkStatus = "Disconnected";
            Debug.Log("Disconnected from Photon services");
        public void joinRoomScene()
        //Joined lobby
        private void OnJoinedLobby()
            Debug.Log("Joined Lobby");

    This currently how I connect to the master.
  • JohnTubeJohnTube mod
    edited August 8
    Hi @Jakeco19,

    Thank you for choosing Photon!

    What "Scripting Runtime Version" are you using? (Edit -> Project Settings -> Player) under "Configuration"
    It should be "Stable (.NET 3.5 Equivalent)".
    PUN does not support 4.6 yet (see this forum post).

    If you implement these two callbacks which one is triggered and what disconnect cause do you get?
    void OnConnectionFail(DisconnectCause cause)
    void OnFailedToConnectToPhoton(DisconnectCause cause)
  • Jakeco19Jakeco19
    edited August 8
    Hi @JohnTube

    The Callbacks are never called and yes im using .Net 3.5;
  • JohnTubeJohnTube mod
    edited August 8
    This is tricky to reproduce.
    I think it may be a Unity bug.

    it no longer connects to the master.
    Could you explain this further?
    What happens? Any logs?
  • there is no real way to tell whats going on, other than the basic UI and Debugging that I have done.

    im not to sure how to explain it but it was working at one stage, then stopped working without any edits done to the game.

    using the Demos given, it gets stuck on connecting to name server, and will not proceed past that, but when I build the game it works perfectly fine.
  • Really need a solution this as it makes it impossible to even use Photon. seeing as i cant use the editor.
  • the editor will work for a period of time then after maybe 2 - 3 hours working, it no longer connects to the master.

    Just to make sure I understood this correctly: neither restarting the Unity Editor nor the PC solves the issue?
  • @Christian_Simon Hi,

    yes, you are correct. neither of those worked.
  • Odd, never heard of something similar before.

    How do you try to connect to Photon? Do you use Best Region feature or a certain Cloud Region? Which Connection Protocol do you use? If this occurs next time, please try to change at least one of the settings and see what happens afterwards.

    When you are already taking a look at the PhotonServerSettings, you can also try to set Pun Logging to Full and Network Logging to ALL and see, if this might give you any further hint about the problem.
  • iv tried all the options for trying to connect, none have worked. Have tried both UDP and TCP.

    have tried but once again never gets an error sent instead just sits on connecting to name server.
  • Fixed the Issue, simply the fix is if you're using auto Sync on a folder that contains your project files turn that off or move the project files and it fixes it.
  • Hi @Jakeco19,

    Thank you for the heads up.
    I'm glad you finally solved this mystery.

    I'm however not sure how to suggest the fix to other customers who might have the same issue.
    Could you please elaborate and share more details.
    That would be very much appreciated.
  • @JohnTube

    Here is how it was happening,

    I had the folder of my unity project in my OneDrive folder, which auto-syncs. This would be any case for google drive, megasync, Dropbox and pretty much any service that has a folder on your computer that syncs to the cloud.

    I moved that to local storage folder, say the desktop or C drive, and that fixed the issue.

    The best fix that i could say is to move the folder to somewhere that doesn't auto sync to a cloud service.
Sign In or Register to comment.