title: PlayerCount in a room [PHOTON]
body: <p>I am doing a multiplayer game and I want my player to be able to join the room when there is one player available (other than him).I wanted to appear a text that said : " Waiting.." till one player will joint the room. I tried this 2 codes in OnJoinedRoom(), but should I create another function like FindOpponent() ? this are the codes : </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code> if(PhotonNetwork.CurrentRoom.PlayerCount == 2)
          {
              PhotonNetwork.CurrentRoom.IsOpen = false;
          }</code></pre>
  </div>
  </div>
  </p>
  
  <p>but didn't work 
  and neither this :</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>  int playerCount = PhotonNetwork.CurrentRoom.PlayerCount;
          if(playerCount != 2)
          {
              waitingStatusText.text = "Waiting for opponent";
          }</code></pre>
  </div>
  </div>
  </p>
  
  <p>this is the script that I am using :</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>using System.Collections;
  using System.Collections.Generic;
  using UnityEngine;
  using Photon;
  using Photon.Pun;
  using UnityEngine.UI;
  using Photon.Realtime;
  
  public class MPManager : MonoBehaviourPunCallbacks, IPunObservable
  {
      public PlayFabAuth auth;
  
      
  
  
      public string GameVersion;
      public Text connectState;
      
      public GameObject[] DisableOnConnected;
      public GameObject[] DisableOnJoinRoom;
      public GameObject[] EnableOnConnected;
      public GameObject[] EnableOnJoinRoom;
      public LoadedPlayer loadPlayer;
      // Start is called before the first frame update
      void Start()
      {
         
  
      }
  
      // Update is called once per frame
      void Update()
      {
          
      }
  
      private void FixedUpdate()
      {
          connectState.text = "Connection: " + PhotonNetwork.NetworkClientState;
      }
      public void ConnectToMaster()
      {
          //  PhotonNetwork.connectionStateDetailed
          PhotonNetwork.ConnectUsingSettings();
      }
  
      public override void OnConnectedToMaster()
      {
          PhotonNetwork.JoinLobby();
      }
      public override void OnJoinedLobby(){
          
          foreach(GameObject disable in DisableOnConnected){
              disable.SetActive(false);
          }
          foreach (GameObject enable in EnableOnConnected){
              enable.SetActive(true);
          }
          
          
      }
  
      public void CreateOrJoin()
      {
          PhotonNetwork.LeaveLobby();
          PhotonNetwork.JoinRandomRoom();
      }
      public override void OnJoinRandomFailed(short returnCode, string message)
      {
  
          RoomOptions rm = new RoomOptions
          {
              
              MaxPlayers = 3,
              IsVisible = true
  
          };
          int rndID = Random.Range(0, 3000);
          PhotonNetwork.CreateRoom("Default: " + rndID, rm, TypedLobby.Default);
      }
     
      public override void OnJoinedRoom()
      { 
          foreach (GameObject disable in DisableOnJoinRoom)
          {
              disable.SetActive(false);
          }
          foreach (GameObject enable in EnableOnJoinRoom)
          {
              enable.SetActive(true);
  
          }
          Debug.Log(loadPlayer.currentPlayer.name);
  
          GameObject player =  PhotonNetwork.Instantiate(loadPlayer.currentPlayer.name , Vector3.zero, Quaternion.identity, 0);
          
  
      }
      public override void OnLeftRoom()
     
      {
          PhotonNetwork.LeaveRoom();
         
      }
  
      public void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info)
      {
          throw new System.NotImplementedException();
      }
  }</code></pre>
  </div>
  </div>
  </p>