Want each client to set a parameter on network object once its created

So our master client creates a network object. There is one parameter in this network object which I want to change for each client depending on the state of that particular client. Initially I tried putting the check in the Start() method but obviously that start method is only run by whoever initially instantiates the network object.

Is there a callback for some other method that every single client will run as soon as it receives notification that a new network object has been created?

I guess alternatively I could try putting something that is run the first time the Update() method is called but that seems really messy. Any advice appreciated. Thanks.

Comments

  • JohnTube
    JohnTube mod
    edited July 2020
    Hi @hellohallo,

    If you instantiate using PhotonNetwork.Instantiate then, add a MonoBehaviour (or MonoBehaviourPun or MonoBehaviourPunCallbacks) next to PhotonView and use photonView.IsMine in Start or OnEnable or Update to make sure you control (own) the object locally then apply the change.