Search Unity

  1. Are you interested in providing feedback directly to Unity teams? Sign up to become a member of Unity Pulse, our new product feedback and research community.
    Dismiss Notice

Help Wanted PUN 2 OnPlayerLeftRoom is never called

Discussion in 'Multiplayer' started by MarioetLesHerosNintendo, Jun 5, 2021.

  1. MarioetLesHerosNintendo


    Feb 18, 2019
    Hi !
    I have a little problem. I made a scene called "waiting room" where all player who joined a same room are listed.
    However, when a player quits the room, his prefab is'nt destroyed because the fnction OnPlayerLeftRoom is not called.
    I don't understand why...
    The player quits the room by clicking the a button that called LeaveRoom() function and make the player to go to title screen.

    Can u help me to resolve my problem ?

    Thanks for answers !
  2. tobiass


    Apr 7, 2009
    If OnPlayerLeftRoom is not called, this needs fixing first.
    When you call LeaveRoom(), don't call Disconnect() right after that.

    The problem could also be that the script (which is waiting for the callbacks) does not register for them. Are you sure the script gets callbacks at all?

    Enable the SupportLogger in the PhotonServerSettings and check the logs on both sides if you see the leave.