Can't LeaveRoom OnApplicationPause Android

Options
I am having a problem when calling LeaveRoom() in the OnApplicationPause(). When I pause the applicaion(hit home button in android), the player doesn't leave the room on the screen of the others clientes, and stay stopped there. When you reopen the application from the background, the player leave the room and disapear from others clientes screen. Seens that the method leaveroom is just called after the player reopen the application.
If I call Disconnect instead of LeaveRoom, the player leave the room ok.

Best Answer

Answers

  • IcomxD
    IcomxD
    edited November 2018
    Options
    here is my code:
    void OnApplicationPause(bool isPaused){
    		if (isPaused) {
    			PhotonNetwork.LeaveRoom();
    		}
    	}
    Am I doing something wrong?
  • IcomxD
    Options
    Thanks man, this worked perfectly!