When i try and create a room, it doesn’t create and i have absolutely no cue why, i’ve tried debugging and i can’t find the issue. Here is my code:
using UnityEngine;
using System.Collections;
public class StartRoom : MonoBehaviour {
public UnityEngine.UI.InputField input;
public string RoomName="";
// Use this for initialization
void Start ()
{
}
// Update is called once per frame
void Update ()
{
RoomName=input.value;
if(Input.GetKeyDown(KeyCode.Return))
{
RoomName=input.value;
StartRoomByName();
}
//Debug.Log(PhotonNetwork.GetRoomList().Length);
}
void StartRoomByName()
{
PhotonNetwork.ConnectUsingSettings ("1.0");
}
void OnGUI()
{
GUILayout.Label (PhotonNetwork.connectionStateDetailed.ToString ());
}
void OnJoinedLobby()
{
PhotonNetwork.CreateRoom (RoomName);
}
void OnCreatedRoom()
{
PhotonNetwork.JoinRoom (RoomName);
}
}
And here is the error i keep getting:
JoinRoom failed. Client is not on Master Server or not yet ready to call operations. Wait for callback: OnJoinedLobby or OnConnectedToMaster.
UnityEngine.Debug:LogError(Object)
PhotonNetwork:JoinRoom(String) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonNetwork.cs:1575)
StartRoom:OnCreatedRoom() (at Assets/StartRoom.cs:42)