How to send RPC from client to server and catch it

ice cold

Active Member
Trusted Member
Member
Oct 24, 2016
606
871
43
Canada
So i have been struggling this for awhile and i keep getting this error
Code:
No receiver found for RPC 'POS' at uLinkNetworkView "ServerManagement(Clone)" (ViewID 61177)
client code
C#:
  RustServerManagement.Get().networkView.RPC("POS", uLink.NetworkPlayer.server, pos);
SERVER SIDE CODES

C#:
   rpcobject = new GameObject();
                rpcobject.AddComponent<Communication>();
                UnityEngine.Object.DontDestroyOnLoad(rpcobject);
C#:
 public class Communication : MonoBehaviour
    {
        [RPC]
        public void POS(Vector3 pos)
        {
            Logger.Log(pos.Tostring());
        }
    }
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,066
4,462
113
At your house.
github.com
That's not how you send RPCs from clientside...

C#:
uLink.NetworkView.Get(PlayerClient.GetLocalPlayer().findnetworkviewofplayerherebecauseidunnothevariablename)
                                    .RPC("asd", PlayerClient.GetLocalPlayer().findnetworkviewofplayerherebecauseidunnothevariablename);
 
  • Winner
Reactions: ice cold

ice cold

Active Member
Trusted Member
Member
Oct 24, 2016
606
871
43
Canada
That's not how you send RPCs from clientside...

C#:
uLink.NetworkView.Get(PlayerClient.GetLocalPlayer().findnetworkviewofplayerherebecauseidunnothevariablename)
                                    .RPC("asd", PlayerClient.GetLocalPlayer().findnetworkviewofplayerherebecauseidunnothevariablename);
aaaai thanks bro, Love you