PhotonView with ID 2001 has no method marked with the [PunRPC](C#) property! Args: Int32

This is the error i am getting

PhotonView with ID 2001 has no method "RPCFunction" marked with the [PunRPC](C#) or @PunRPC(JS) property! Args: Int32

and this is the Code i am Using

public void CallRPCMethod(int index)

     {
         GetComponent<PhotonView>().RPC("RPCFunction", PhotonTargets.MasterClient, index);
     }
 
 
     [PunRPC]
     public void RPCFunction(int index)
     {
         //int i = int.Parse(index);
         foreach (GemsAndBoosterIndexing indexRefferer in FindObjectsOfType<GemsAndBoosterIndexing>())
         {
             if (index == indexRefferer.index)
             {
                 PhotonNetwork.Destroy(indexRefferer.gameObject);
                 break;
             }
         }
     }
i have no idea why this is happening. Please Help

I have also checked RPC setting in Editor and "RPCFunction" is added in that list.i am using Unity 2018.2

Comments

Sign In or Register to comment.