Question by
whatisthislol · Nov 23, 2020 at 09:16 AM ·
photonmaps
Join random room with custom properties
Hello so I have this script for the create room public void CreateRoomOnClick() {
if(1Vote == true && vote1 == true)
{
ExitGames.Client.Photon.Hashtable customProperties = new ExitGames.Client.Photon.Hashtable();
customProperties["maps"] = maps[currentmap].name;
RoomOptions roomOps1 = new RoomOptions()
{
CustomRoomProperties = customProperties,
IsVisible = true,
IsOpen = true,
MaxPlayers = (byte)roomSize
};
roomOps1.CustomRoomPropertiesForLobby = new string[] { "maps" };
roomName = GetRandomMatchID();
PhotonNetwork.CreateRoom(roomName, roomOps1);
codeDisplay.text = roomName;
}
}
and then to join a random room with specific map I have this script
public void JoinRoom1()
{
ExitGames.Client.Photon.Hashtable customProperties = new ExitGames.Client.Photon.Hashtable();
customProperties["maps"] = maps[currentmap].name;
PhotonNetwork.JoinRandomRoom(customProperties, 1);
}
I also have this set up in inspector
but whenever I press the button to join the random room I get this error
Operation JoinRandomGame (225) not called because client is not connected or not ready yet, client state: JoiningLobby
Does anyone know what I'm doing wrong?
maps.png
(14.0 kB)
Comment