LeaveRoom

Options
Game Scene 

Button  I want to go back to the lobby

but 
After I press it, other players will follow me to the scene 0

I just want to go back to the lobby by myself

 
sorry I'm not good at English using translation


Answers

  • Crazy416
    Options

    This Can Be Done if you disconnect Your Self from Server.

    If You start A coroutine when someone clicks the leave room button it will be pretty easy to do

    public void LeaveRoom()

    {

    StartCoroutine(leaveRoom());

    }

    IEnumerator leaveRoom()

    {

    PhotonNetwork.Disconnect ();

        while (PhotonNetwork.IsConnected)

            yield return null;

        PhotonNetwork.LoadLevel(0);

    }


    And Dont Forget To add

    using System.Collections

    at Top

    Maybe This is What You Want.

  • yuch0826
    yuch0826
    edited March 2022
    Options

    tnk you