I am recieving an error "Game Does Not Exist"
Options
I am working on a game with Photon. I'm using PUN2. I am trying to create a room with a name that is generated by the masterclient. They then share the room name with a friend, who enters it into a text field, and that is used to join the room. I had been working on the game, and this technique had worked previously. All of a sudden, I start receiving the message that "Game Does Not Exist". I've set the console to confirm the client that creates the game, and to confirm the name of the game created. I still get this error from any other client that attempts to join. I am including a copy of my script.
using System.Collections; using System.Collections.Generic; using UnityEngine; using Photon; using Photon.Pun; using Photon.Realtime; using UnityEngine.UI; using UnityEngine.SceneManagement; public class TicTacPhotonController : MonoBehaviourPunCallbacks { public GameObject mainPanel; public GameObject createGamePanel; public GameObject joinGamePanel; public Text createFailText; public Text joinFailText; [SerializeField] string gameName; // Start is called before the first frame update void Start() { mainPanel.SetActive(false); createGamePanel.SetActive(false); joinGamePanel.SetActive(false); PhotonNetwork.ConnectUsingSettings(); } public override void OnConnectedToMaster() { Debug.Log("Connection To Photon Succeeded"); mainPanel.SetActive(true); createGamePanel.SetActive(false); joinGamePanel.SetActive(false); } #region Panel Navigation public void OnClickCreateGame() { mainPanel.SetActive(false); createGamePanel.SetActive(true); joinGamePanel.SetActive(false); } public void BackToMainPanel() { mainPanel.SetActive(true); createGamePanel.SetActive(false); joinGamePanel.SetActive(false); } public void OnClickJoinGame() { mainPanel.SetActive(false); createGamePanel.SetActive(false); joinGamePanel.SetActive(true); } #endregion public void GetGameName(string gameNameIn) { gameName = gameNameIn; } #region Create Game public void CreateNewGame() { PhotonNetwork.AutomaticallySyncScene = true; RoomOptions myRoomOptions = new RoomOptions { MaxPlayers = 2, IsOpen = true, IsVisible = true }; PhotonNetwork.CreateRoom(gameName.ToString(), myRoomOptions, TypedLobby.Default); } override public void OnCreatedRoom() { Debug.Log("Game Created"); Debug.Log(PhotonNetwork.CurrentRoom.Name); SceneManager.LoadScene("TicTacWaiting"); } override public void OnCreateRoomFailed(short returnCode, string message) { createFailText.text = "Failed to create game, try again"; Debug.Log(message); } #endregion #region Join Game public void JoinGame() { PhotonNetwork.AutomaticallySyncScene = true; PhotonNetwork.JoinRoom(gameName.ToString()); } public override void OnJoinRoomFailed(short returnCode, string message) { joinFailText.text = "Failed to join game, try again"; Debug.Log(message); } public override void OnJoinedRoom() { Debug.Log("Game Joined"); Debug.Log(PhotonNetwork.CurrentRoom.Name); } #endregion }
0
Answers
-
Hi @callthecowvalry,
Thank you for choosing Photon!
Go through our "Matchmaking Checklist" especially "Best Region Considerations".0