Getroomlist does not work
Options
Rivax95
✭
Hi everyone
How do I make this work?
Sorry for my bad english
private void OnJoinedLobby() { RoomOptions Options=new RoomOptions(); Options.MaxPlayers=10; Options.IsVisible=true; for (int i = 0; i < 3; i++) { PhotonNetwork.CreateRoom("Room " + i, Options, null); Debug.Log("for" + i); } } private void OnCreatedRoom() { Debug.Log(PhotonNetwork.GetRoomList().Length); } void Update () { RoomInfo []rom = PhotonNetwork.GetRoomList(); cantrooms = rom.Length; }GetRoomList always return 0
How do I make this work?
Sorry for my bad english
0
Comments
-
up!0
-
Hi @Rivax95,
Thank you for choosing Photon!
It seems like you're new to Photon, I recommend you start with "PUN Basics Tutorial".
Also if you have a question or problem, first use the search feature on the forum.
There is a high chance someone else stumbled into the same issue and got an answer.
To answer your question, rooms listing is available only when joined to a compatible lobby.
The player can either be joined to a lobby or to a room, not both at the same time.
Also, you should get the room list preferably inside the callbackOnReceivedRoomListUpdate()
.0