PhotonView stating method doesn't have proper number of arguments.

Options
I have many other [PunRPC] calls which work just fine. After modifying an existing call, it breaks. I'm not sure what's causing this. I went to the PhotonServerSettings and can see that RPC_AllPlayersInGameboard is in the Rpc list; I have tried clicking refresh.

I receive the following error:
PhotonView with ID 2 has no method "RPC_AllPlayersInGameboard" that takes 1 argument(s): PhotonPlayer

method:
[PunRPC]
private void RPC_AllPlayersInGameboard(PhotonPlayer[] players)
caller:
photonView.RPC("RPC_AllPlayersInGameboard", PhotonTargets.All, PhotonNetwork.playerList);

Comments

  • Distul
    Options
    Can't find edit button...

    Also, when I remove arguments from caller and RPC_AllPlayersInGameboard() the RPC works.
  • Distul
    Options
    BUMP! Issue still present.
  • JohnTube
    JohnTube ✭✭✭✭✭
    edited March 2017
    Options
    Hi @Distul,

    According to this other forum discussion, here is how you should call the RPC:
    photonView.RPC("RPC_AllPlayersInGameboard", PhotonTargets.All, (object)PhotonNetwork.playerList);
    or
    photonView.RPC("RPC_AllPlayersInGameboard", PhotonTargets.All, PhotonNetwork.playerList as object);
  • Distul
    Options
    I'll give that a shot and follow up. Thanks.
  • Distul
    Options
    JohnTube said:

    Hi @Distul,

    According to this other forum discussion, here is how you should call the RPC:

    photonView.RPC("RPC_AllPlayersInGameboard", PhotonTargets.All, (object)PhotonNetwork.playerList);
    or
    photonView.RPC("RPC_AllPlayersInGameboard", PhotonTargets.All, PhotonNetwork.playerList as object);
    This worked. Thank you.