I have set up a server and a client, both only a main camera, both only 1 script.
The client connects (this is successful, disconnecting after is shut down works as well, no network issues).
This then calls the SERVERS RPC.
Client uses:
void OnConnectedToServer() {
Debug.Log("Connected to server");
MakeCall();
}
// Update is called once per frame
void MakeCall () {
networkView.RPC("DataRequest",RPCMode.Server,"test");
}
And then the server has:
[RPC]
void DataRequest(string JsonCall, NetworkMessageInfo info){
Debug.Log("Made a data request: " + info.sender);
}
However, this setup results in one and the same error over and over:
RPC call failed because the function 'DataRequest' does not exist in the any script attached to'Main Camera'
I am at a complete loss as to why this happens, since the script is running on the Main Camera object. Does anyone know what is going on?
Thanks in advance,
Smiley