Photon not connecting on hosted WebGL (itch.io and Unity play), but working on Windows build

Hi,

I’m new to Photon. Our new game is connecting and working in both the Unity editor and Windows build correctly. However, when we host the WebGL build on either itch.io or Unity Play (using the WebGL publisher), Photon does not connect to the server.

The line of code below seems to just not get called when it is a hosted WebGL build.

private void Awake()
{
        PhotonNetwork.ConnectUsingSettings(VersionName);
}

Make sure it’s not called.
E.g. add Debug.Log("Calling ConnectUsingSetting") before and after this line.
Check the browser’s JS Console for any errors.

Tried that, definitely not connecting. In the web browser the error we are getting:
““afbc6604-f456-439a-9f61-48a5fd535963:8 JoinOrCreateRoom failed. Client is not on Master Server or not yet ready to call operations. Wait for callback: OnJoinedLobby or OnConnectedToMaster.””

That error kind of explains what you should do. Use the callbacks and don’t call JoinOrCreateRoom before OnConnectedToMaster was called…

What callback? I am trying to connect to the server on Awake().

If I am not connecting to the server, what callback would I receive?

For the record, the project is/was using Photon Classic in Unity 2019.4.35f1.

Is it just a must to upgrade to Photon Pun 2? The upgrade seems like a lot

We don’t support PUN Classic anymore. I would recommend an update but if your game is otherwise done and working … we won’t stop you releasing it.

If I am not connecting to the server, what callback would I receive?

Check the return value of the connect method. Is it false, there won’t be a callback. If it’s true but there is another error, there is an OnDisconnected callback. The reference docs and in-code comments should point this out.
In doubt, the PUN Basics Tutorial also covers these topics.