Moving multiple players to other scene

Hi all, im new using PUN and i have a problem when I try to move all the players to another scene.
I think it must be easy to solve, but i dont really know how.
I have a scene in unity, there are a few spawn points in where the players join it

Im using this - PhotonNetwork.JoinRandomRoom(); and all the players joined the same room (i guess)

In the scene there are two type of players (admins and normal players), and I just want when an admin player press a button, the scene change for all the people who are in and they join the other room at the same time (sync).

I tried to PhotomNetwork.LoadLevel but I dont really know what that does and its not working.

Please, any kind of help will be a great help to me, im a bit lost.

Thanks - Jhin

Best Answer

Answers

  • Kurtav
    Kurtav ✭✭
    edited May 2017
    - Before the execution of this line(PhotomNetwork.LoadLevel), please write PhotonNetwork.automaticallySyncScene = true;
    - The master client executes this line (PhotomNetwork.LoadLevel). It loads all players into the scene
  • Kurtav said:

    - Before the execution of this line(PhotomNetwork.LoadLevel), please write PhotonNetwork.automaticallySyncScene = true;
    - The master client executes this line (PhotomNetwork.LoadLevel). It loads all players into the scene

    Thank you Kurtav your answer was very helpfull! I can understand how PhotonNetwork.automaticallySyncScene = true works now . But It must be called by the MasterClient...

    How can I create a room as a masterClient? I read that you can only ask if one client is PhotonNetwork.isMasterClient ...

    Other option from non-master client is sending a RPC to a master asking it to do an action. But I have no idea about how to do it.

    Any kind of help will be a great help to me. TY Jhin.