PhotonView with ID 2001 has no method marked with the [PunRPC](C#) property! Args: Int32
Options
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
I have also checked RPC setting in Editor and "RPCFunction" is added in that list.i am using Unity 2018.2
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
0
Comments
-
up !0
-
este seu script com o RPC deve estar no mesmo GameObject que o PhotonView, para conseguir fazer a ligação.
EDIT (translated from Portuguese to English):your script with RPC must be in the same GameObject as PhotonView, in order to work.0