Buffered RPC problem

Hi, I ve been getting this problem since a long time and did not find any solutions for this.
I have called one RPC whose target is buffered. when another client is connected in the same room. The RPC is called before registering the photonview so i am getting this error "Remote rpc is called but photonview doesnt exists"
What should i do?

Comments

  • Also in an alternative, I use PhotonNetwork.Instantiate to spawn the GO in all clients and that gameobject has the script in which all the RPCs are there. and when i use GameObject.Find().Getcomponent<>() in start of that GO I am getting null reference exception in other clients who are getting buffered RPCs.
  • You should use PhotonNetwork.Instantiate or PUN can't be blamed if a GameObject is not known before you call RPCs.
    I can't say why you don't succeed with GetComponent. Maybe the script is not active yet? Then it's not found by the method you use.
    Why do you have to find a script that has RPCs?

    It sounds more like issues with organization in Unity than Photon problems. I am not sure if we can help with that. If so, we would need a small repro case.
  • I think you misunderstood me. I am not finding a script that has RPC.
    My buffered RPC is using variables that are of another script so i have to get that variable by "GameObject.Find().Getcomponent<>().variableName". but I am getting null reference even if the script is already active.
    Why Buffered RPC on newly connected client is called before Start of any scripts?
  • I solved this problem. Buffered RPC is not a solution for getting info from master client.
  • Thanks for not helping Tobias! :'(
Sign In or Register to comment.