Quantcast
Channel: Recent Discussions — Photon Engine
Viewing all articles
Browse latest Browse all 15755

GetRoomList() does not show any room when it called immediate after joining a lobby

$
0
0
Hello,

I want the room list to be shown when a player join a lobby, thus I use GetRoomList() in OnJoinedLobby(), like this:
public override void OnJoinedLobby()
{
foreach (RoomInfo room in PhotonNetwork.GetRoomList())
{
Debug.Log("room name:" + room.Name + " " + room.PlayerCount);
}
}
It does not show anything.

However, if I call GetRoomList() in Awake(), the console will log the rooms existing in the lobby. And it also work when I make a button and make its Onclick to GetRoomList().

But I don't want GetRoomList() to be called in every frame, nor do I want to ask the player to press a button to show room list. Anybody know why it does not work in OnJoinedLobby()?

Sorry that I post this in the wrong place, but I can't delete this post. I have posted this question again in the right place:
forum.photonengine.com/discussion/9052/getroomlist-does-not-show-any-room-when-it-called-immediate-after-joining-a-lobby

Viewing all articles
Browse latest Browse all 15755

Trending Articles