RPC call failed because the function 'server_requestNewPlayerRPC' does not exist in any script attached to'GUIManager'

I have two prefabs that have networkview components: GUIManager and GameManager.
I want to call a RPC function in the script of GameManager to server (RPCMode.Server), the function is just in the script of GameManager, the lines is in the following:

if(Network.isClient) {
networkView.RPC("server_requestNewPlayerRPC", RPCMode.Server, Network.player);
}

However, I find that the network will also call the RPC function in the script of GUIManager, but I just define the function in GameManager. As a result, the error commes:

RPC call failed because the function 'server_requestNewPlayerRPC' does not exist in any script attached to'GUIManager'

Any help would be appreciated, thx very much !

Drop in an “empty” function on the sending side.

It’s just “how it is” - you have to do that in Unity’s general networking model.

Think of it as rather like having to give a prototype of a function - it’s harmless and tidy - it’s not a bad system.