The Photon Forum
is Closed Permanently.

After many dedicated years of service, we have made the decision to retire our Forum and switch to read-only: we´ve saved the best to last! Your search result can be found below. Plus, we offer support via these channels:

Try Our
Documentation

Please check if you can find an answer in our extensive documentation on PUN.

Join Us
on Discord

Meet and talk to our staff and the entire Photon-Community via Discord.

Read More on
Stack Overflow

Find more information on Stack Overflow (for Circle members only).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

Joining a room fails every time NEED HELP unity

UnkownDude
2022-06-12 16:34:13

in my code i have a function and when called its supposed to join a room with the same name as the input field it looks like this

public void OnClickJoin()

{

PhotonNetwork.JoinRoom(JoinInputField.text);

}

and this is how I detect if joining a room fails

public override void OnJoinRoomFailed(short returnCode, string message)

{

Debug.Log("Joiningfailed");

}

There's no errors in the script I don't know what to do it doesn't make sense i can provide the full script if you want it

Comments

Tobias
2022-06-14 12:34:34

You need to register your script to get callbacks. In doubt, enable the "SupportLogger" in the PhotonServerSettings to get more log output. There is certainly some error callback or other info.

To join a room, it must be existing in the same region you use with "this" client. See Matchmaking Checklist.

Have a look at the script ConnectAndJoinRandom to get an idea of how to quickly get into a room.

UnkownDude
2022-06-15 18:33:51

Thank you it the debug did not give any information but when i put it in a startfunctecion i fixed my problem but i found a new one get this error when i load into the game scene its prety long here it is

NullReferenceException: Object reference not set to an instance of an object

Photon.Pun.PhotonTransformViewClassic.OnPhotonSerializeView (Photon.Pun.PhotonStream stream, Photon.Pun.PhotonMessageInfo info) (at Assets/Photon/PhotonUnityNetworking/Code/Views/PhotonTransformViewClassic.cs:128)

Photon.Pun.PhotonView.SerializeComponent (UnityEngine.Component component, Photon.Pun.PhotonStream stream, Photon.Pun.PhotonMessageInfo info) (at Assets/Photon/PhotonUnityNetworking/Code/PhotonView.cs:557)

Photon.Pun.PhotonView.SerializeView (Photon.Pun.PhotonStream stream, Photon.Pun.PhotonMessageInfo info) (at Assets/Photon/PhotonUnityNetworking/Code/PhotonView.cs:521)

Photon.Pun.PhotonNetwork.OnSerializeWrite (Photon.Pun.PhotonView view) (at Assets/Photon/PhotonUnityNetworking/Code/PhotonNetworkPart.cs:1723)

Photon.Pun.PhotonNetwork.RunViewUpdate () (at Assets/Photon/PhotonUnityNetworking/Code/PhotonNetworkPart.cs:1652)

Photon.Pun.PhotonHandler.LateUpdate () (at Assets/Photon/PhotonUnityNetworking/Code/PhotonHandler.cs:168)

Thank you

Back to top