When i trying to create room, nothing happens and there is an error in title. What should I do?
If it is possible, than write what specificly should be replaced.
Full error:
CreateRoom failed. Client is on MasterServer (must be Master Server for matchmaking)but not ready for operations (State: PeerCreated). Wait for callback: OnJoinedLobby or OnConnectedToMaster.
UnityEngine.Debug:LogError (object)
Photon.Pun.PhotonNetwork:CreateRoom (string,Photon.Realtime.RoomOptions,Photon.Realtime.TypedLobby,string[]) (at Assets/Photon/PhotonUnityNetworking/Code/PhotonNetwork.cs:1782)
MenuManagerScript:CreateRoom () (at Assets/MenuManagerScript.cs:15)
UnityEngine.EventSystems.EventSystem:Update () (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/EventSystem.cs:385)
Full code:
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using Photon.Pun;
using Photon.Realtime;
public class MenuManagerScript : MonoBehaviourPunCallbacks
{
public InputField createInput;
public InputField joinInput;
public void CreateRoom() {
RoomOptions roomOptions = new RoomOptions();
roomOptions.MaxPlayers = 4;
PhotonNetwork.CreateRoom(createInput.text, roomOptions);
}
public void JoinRoom() {
PhotonNetwork.JoinRoom(joinInput.text);
}
public override void OnJoinedRoom() {
PhotonNetwork.LoadLevel("Game");
}
}
I take code from this video: https://youtu.be/IfP5ChmhVFk?t=485