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

everything worked well for some time
anyone has any solution how to fix it and how is photonView
spat out the error?
private void OnTriggerEnter(Collider other)
    {

        if (other.gameObject.GetComponent() != null)
        {
            
            if (!Network.IsOffline())
            {
                if (other.gameObject.GetComponent() != null)
                {
                    other.gameObject.GetComponent().RPC("RPC_Obrarzenia", RpcTarget.All, Damage);
                }
            }
            else
            {
                other.gameObject.GetComponent().RPC_Obrarzenia(Damage);
            }
        }
        if (!other.isTrigger)
        {
            Network.Destroy(gameObject, true);
        }
    }
public class Zdrowie : MonoBehaviourPun,IPunObservable {
     //~100 code line
    [PunRPC]
    public void RPC_Obrarzenia(int value)
    {
        zdrowie -= value;
    }
}

Comments

  • Hi @Nori_SC,

    Thank you for choosing Photon!

    Make sure Zdrowie component is on the same GameObject as the PhotonView.
  • Nori_SCNori_SC
    edited August 13
    @JohnTube
    is on enemy GameObject and spawn at run time
    but the script checks if it is assigned to an object

    I don't know why this is because I completely don't understand it
  • never mind fixed it
    spawner required a little delay in the start function
Sign In or Register to comment.