whenever i leave a room it kicks all players out how could i fix this

Options

whenever any player leaves master or not it kicks everyone out, how could i stop this. my code: public void Menu()

  {

    if (view.IsMine)

    {

      PhotonNetwork.LeaveRoom();


      SceneManager.LoadScene("MenuM");

    }

  }

Best Answer

  • LittleTimmy52
    Answer ✓
    Options

    I had 2 override voids and one didn't have view is mine so I got rid of the duplicate and it fixed the problem I just forgot to say that here, but thanks for your help anyways.

Answers

  • Tobias
    Options

    Keep in mind that "IsMine" can be true for one instance, if a prefab is instantiated by each player.

    Meaning: If each player controls at least one object with this script, it may leave the room (if Menu() is being called).

  • LittleTimmy52
    Answer ✓
    Options

    I had 2 override voids and one didn't have view is mine so I got rid of the duplicate and it fixed the problem I just forgot to say that here, but thanks for your help anyways.