How to call punRPC to MasterClient

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)

Hi,

the second parameter of the RPC call already contains the target players. You can use PhotonTargets.MasterClient in order to just send this RPC to the MasterClient. In your case this should look like this: this.photonView.RPC("PunKill", PhotonTargets.MasterClient); Please note, that the target call will only be processed by the MasterClient, no other client will run whatever is in the targeted function.