How do I use RoomInfo?
Options
In my script, I would like to check if the player count of a room and maximum amount of players allowed are the same. If they are, a new scene would load. After attempting to do so, I got an error telling me that RoomInfo.maxPlayers and RoomInfo.playercount did not exist. I tested and Debug.Log(PhotonNetwork.RoomInfo) proves that RoomInfo is null even though I currently am in a room. PhotonNetwork.Room is also null. Why is this?
Thanks in advance.
Thanks in advance.
0
Comments
-
0
-
Hey @YBtheS,
From the stack trace I do not see any PUN callback. I don't know how or when you detect a player has joined a room!
Please implement PUN callbacks and check the room related info in there:
OnCreatedRoom()
OnJoinedRoom()0 -
@JohnTube
Code:function OnJoinedRoom() { Debug.Log("Joined Room"); Debug.Log(PhotonNetwork.Room); Debug.Log(PhotonNetwork.RoomInfo); }
Screenshot: http://prnt.sc/dkc7d10 -