Hi all,
So I just started with Unity last week and am trying to figure out how exactly RPC’s can be used.
I would like to have a server which is just a standalone application that creates a server Network.InitializeServer(maxNumPlayers, serverPort, false);
and stays open.
However, I seem to be struggling with doing this and using RPC’s. For example I have a chat system that consists of a game object in all clients, with an attached script that uses rpc’s. I call the RPC using networkView.RPC ("SendChatMsg", RPCMode.All, msgToSend);
and the RPC is defined lower in the code as
[RPC]
void SendChatMsg(string msg) {
chatLog = chatLog + "Message: " + msg + "\n";
}
My problem is that when I make the networkView.RPC call, it seems to call the function on the same client, but does not call it on any other networked clients.
What am I missing here? Does the RPC need to exist on the server as well with a game object and everything?
Thank you for your help!