Why my players do not match in game if they choose the same game mode?
Options
public virtual void OnConnectedToMaster() { Debug.Log("OnConnectedToMaster() was called by PUN. Now this client is connected and could join a room. Calling: PhotonNetwork.JoinRandomRoom();"); ExitGames.Client.Photon.Hashtable expectedCustomRoomProperties = new ExitGames.Client.Photon.Hashtable(); expectedCustomRoomProperties.Add("Modo", usu); PhotonNetwork.JoinRandomRoom(expectedCustomRoomProperties, 4); } public virtual void OnPhotonRandomJoinFailed() { Debug.Log("OnPhotonRandomJoinFailed() was called by PUN. No random room available, so we create one. Calling: PhotonNetwork.CreateRoom(null, new RoomOptions() {maxPlayers = 4}, null);"); ExitGames.Client.Photon.Hashtable ht = new ExitGames.Client.Photon.Hashtable(); RoomOptions ro = new RoomOptions(); ht.Add("Modo", usu); ro.CustomRoomProperties = ht; PhotonNetwork.CreateRoom(null, ro, TypedLobby.Default); }
help!!
0
Answers
-
Hi @Uriel1999,
when setting up the room and also creating the room options, you have to define, which properties are also available in the lobby. You can do this by usingro.CustomRoomPropertiesForLobby
. CustomRoomPropertiesForLobby is a string array where you have to add the name of the property which should be available for Matchmaking. In your case it should bero.CustomRoomPropertiesForLobby = new string[] { "Modo" };
.0