I am Using Photon 2 And I Have Public Rpc Function In One Of My Script, The Function Has An Integer Parameter, This Is How My Function Exactly Looks Like.
[PunRPC]
public void TakeDamage(int amount)
{
playerHealth -= amount;
if (playerHealth <= 0)
{
Debug.Log("Player Died");
}
}
We In Above Code The TakeDamage Function Takes An Integer Called amount. So When I am Calling This Function From Other Scripts, And When The Other scripts Actually Call The Function It Gives A Warning.
PV.RPC("currentTarget.TakeDamage", RpcTarget.AllBuffered, damage);
The PV is a public PhotonView.
RPC method 'currentTarget.TakeDamage(Int32)' not found on object with PhotonView 1003. Implement as non-static. Apply [PunRPC]. Components on children are not found.
you have to give function name ("TakeDamage")
instead of "currentTarget.TakeDamage"
in RPC function.