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 Photon Pun update int to MasterClient int?

Discussion in 'Multiplayer' started by Palmtendo, Jul 23, 2021.

  1. Palmtendo

    Palmtendo

    Joined:
    Dec 22, 2020
    Posts:
    85
    (I'm using Photon not Unity Multiplayer)

    Like the title says I want to update an int from a client, so it has the same value as the MasterClient.

    Here is a example of what I want to do:
    Code (CSharp):
    1. if(!PhotonNetwork.IsMasterClient)
    2.         {
    3.             currentLevel = PhotonNetwork.MasterClient.currentLevel;
    4.         }    
    This code of course is not working its just a visualization of what I want to do.

    The currentLevel int gets defined by Random.Range, thats why I cant can't just sync this.

    I would really appreciate if you could tell me how to do something like this.
    Thanks in advance.
     
  2. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    2,674
unityunity