room options could not be found????
I don't know but it keeps saying that Room Options could not be found
so here is my code
using UnityEngine;
using Photon.Pun;
public class RoomManager : MonoBehaviourPunCallbacks
{
[Tooltip("The maximum number of players per room. When a room is full, it can't be joined by new players, and so new room will be created")]
[SerializeField]
private byte maxPlayersPerRoom = 4;
byte MaxPlayers = 4;
public string roomName = "Room";
// Start is called before the first frame update
void Start()
{
PhotonNetwork.ConnectUsingSettings();
Debug.Log("Connecting..");
}
public override void OnConnectedToMaster()
{
Debug.Log("Connected to server");
base.OnConnectedToMaster();
PhotonNetwork.JoinLobby();
}
public override void OnJoinedLobby()
{
base.OnJoinedLobby();
Debug.Log("We're in the lobby");
PhotonNetwork.JoinOrCreateRoom(roomName, null, null);
}
public override void OnJoinRandomFailed(short returnCode, string message)
{
Debug.Log("PUN Basics Tutorial/Launcher:OnJoinRandomFailed() was called by PUN. No random room available, so we create one.\nCalling: PhotonNetwork.CreateRoom");
// #Critical: we failed to join a random room, maybe none exists or they are all full. No worries, we create a new room.
RoomOptions options = new RoomOptions() ;
PhotonNetwork.CreateRoom(null, new Options{ MaxPlayers = maxPlayersPerRoom });
}
public override void OnJoinedRoom()
{
base.OnJoinedRoom();
GetComponent<PlayerSpawner>().SpawnPlayer();
Debug.Log("We're connected and in a room!");
}
}