How to call punRPC to MasterClient

Options
Hello,

How would you call a punRPC event to be ran by the MasterClient?

I tried with

this.photonView.RPC("PunKill", PhotonTargets.AllBufferedViaServer, thisPlayer.ID, new RaiseEventOptions() { Receivers = ReceiverGroup.MasterClient});

But it complains with:

Exception: cannot serialize(): RaiseEventOptions ExitGames.Client.Photon.Protocol16.Serialize (ExitGames.Client.Photon.StreamBuffer dout, System.Object serObject, Boolean setType)

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @lapinkoira,

    Thank you for choosing Photon!

    As you can read on this page, you set the target of an RPC using the second parameter which is of type PhotonTargets enum. For your case:

    this.photonView.RPC("PunKill", PhotonTargets.MasterClient, thisPlayer.ID);