Set remote player as owner

I'm currently creating my first Photon Cloud based game, and I have encountered a problem -
Through the masterclient, I instantiate (PhotonNetwork, not locally) a player prefab when someone joins, and then send an RPC command with that PhoyonPlayer object, so every client will set it as an owner.
The problem is, that when I use viewID = player.ID I get the following error:
PhotonView with ID 1 has no method "SetPlayer" marked with the [RPC]

Can anyone explain to me why doesn't it work, how to fix it, or what workaround should I use?


  • The error you posted doesn't match the line you are showing.

    The error relates to some method SetPlayer you might be calling as RPC. Where ever you implement this method, it must be flagged as RPC with the attribute. See Marco Polo Tutorial: ... o_Tutorial

    About your line of code: Don't assign a player's ID as viewID. In fact, viewIDs are managed by PhotonNetwork.Instantiate, so you should never change it.