Search Unity

Enter the room with the game in progress

Discussion in 'Multiplayer' started by unity_1F7F85C4172C7968EBB4, Nov 30, 2021.

  1. unity_1F7F85C4172C7968EBB4

    unity_1F7F85C4172C7968EBB4

    Joined:
    Nov 27, 2021
    Posts:
    1
    How can I check if the master has already started the room, and send new players straight into the game?

    I'm doing this for all players after the lobby goes into the game.

    Code (CSharp):
    1.  
    2.   [PunRPC]
    3.   public void Game(string name)
    4.   {
    5.     PhotonNetwork.LoadLevel(name);
    6.   }
    And to enter the lobby

    Code (CSharp):
    1.  
    2.  public void JoinRoom(string nameRoom)
    3.   {
    4.     PhotonNetwork.JoinRoom(nameRoom);
    5.   }
    6.  
    But how can I know if the master has already started the room? To send the player straight into the game rather than the lobby?