This one's quite bizarre but I can't seem to figure it out. It looks pretty straightforward, here's my RPC function and the call -
(https://imgur.com/a/QDzdH0i)
So as can be seen here, I do have a PunRPC-marked function that takes an int parameter, but I still get this error message -
PhotonView with ID 1003 has no (non-static) method "RPC_OffensiveOccupied" marked with the [PunRPC](C#) or @PunRPC(JS) property! Args: Int32
UnityEngine.Debug:LogError(Object)
(https://imgur.com/a/QDzdH0i)
public void OffensiveOccuppied(EPlayerController controller) { int tID = controller.GetComponent<PhotonView>().ViewID; Debug.Log("View Id = " + tID); PhotonView tView = GetComponentInParent<PhotonView>(); tView.RPC("RPC_OffensiveOccupied", RpcTarget.All, tID); } [PunRPC] void RPC_OffensiveOccupied(int controller) { Debug.Log(name + " is now being controlled by " + controller); controllingPlayer = controller; isOccupied = true; PhotonView.Find(controller).transform.position = playerAnchor.transform.position; Camera cam = PhotonView.Find(controller).GetComponentInChildren<Camera>(); cam.transform.SetParent(this.transform); cam.transform.localPosition = cameraAnchor.transform.localPosition; cam.transform.localRotation = cameraAnchor.transform.localRotation; }
So as can be seen here, I do have a PunRPC-marked function that takes an int parameter, but I still get this error message -
PhotonView with ID 1003 has no (non-static) method "RPC_OffensiveOccupied" marked with the [PunRPC](C#) or @PunRPC(JS) property! Args: Int32
UnityEngine.Debug:LogError(Object)