- Home /
photon rpc doesnt work?
Hi guys,
I am working with UFPS multiplayer and i want to make an rpc so this is my call:
photonView.RPC("resetHealth", PhotonTargets.All);
from: master.cs
And this is a code attached to the player in a script: using UnityEngine; using System.Collections; using System.Collections.Generic;
public class vp_BMGame : Photon.MonoBehaviour {
[PunRPC]
public void OnAwakeRPC(byte myParameter)
{
Debug.Log("RPC: 'OnAwakeRPC' Parameter: " + myParameter + " PhotonView: " + this.photonView);
}
}
And i get this error:
PhotonView with ID 1 has no method "resetHealth" marked with the [PunRPC](C#) or @PunRPC(JS) property! Args:
But why what am i doing wrong?
Answer by YoungDeveloper · Aug 02, 2015 at 02:35 AM
You send data to method called "resetHealth", but your script doesn't contain this method.
Your answer
Follow this Question
Related Questions
Problem with UFPS and photon 1 Answer
Photon Instantiate 2 Answers
photon player freak out! 1 Answer
Photon Networking - What function(s) are called when a player (not me) is spawned? 2 Answers
Is possible to spawn 2d image in photon networking ? 1 Answer