PhotonNetwork.LoadLevel changes scene for another client!

I am building a bomberman-like game and testing with 2 players. When the game ends and result screen shows, I have a button on the result screen that should allow that particular client to leave the room and go back to Main Menu.

I have implemented the code as such that a function named OnClickLeave was called and run PhotonNetwork.LeaveRoom(). In my callback OnPlayerLeftRoom, i call SceneManager.LoadScene(0). However, when i run the apk on both Unity Editor and my phone, upon clicking of the leave button, it leaves the room correctly for individual clients but changes scene for one another. How do I ensure that upon leaving the room, the client will load scene on it's end instead of the other client?

Comments

  • Resolved my own issue. I should have called OnLeftRoom instead of OnPlayerLeftRoom.
Sign In or Register to comment.