Force a RPC to be called on a networkview of another GameObject

The error I get:

RPC call failed because the function 'IAmReady' does not exist in any script attached to'GameDirector'

So I have two game objects. One is called GameDirector which manages the logic for the current scene that is loaded (I am basically doing a bunch of multiplayer minigames). The other is called Director and this game object manages the communications to the master server and keeps track of the players and a bunch of other stuff that gives as little networking overhead as possible to the minigames so one can churn them out fast.

The problem I am having is that when the two players connect to eachother and start the game I need to make sure that both players have loaded the scene before I start instantiating the player characters (otherwise the Network.Instantiate will just get lost if a client is still loading). So I send out an RPC to all players when they have loaded. So when the player has received "IAmReady" from all other players then its time to start the game.

  1. The function for the RPC is inside a script of Director
  2. These queries are started when the GameDirector calls kDirector.DoneLoading() at the end of the Start() function of the logic script in GameDirector;
  3. For some reason the RPC tries to execute for scripts attached to GameDirector rather than for Director.
  4. The networkView.RPC call and the [RPC] function are in the same script file.
  5. How do you tell the networkView that the RPC should be executed on the Director instead? kDirector.networkView.RPC yields the same result.

I managed to solve a similar(ish) problem with this:

.GetComponent(NetworkView).networkView.RPC(“MyFunction”, RPCMode.AllBuffered, vars);

I hope this helps you and others that have a similar issue

I hope this can help you, but to tell you the truth I was not able to make it work (seems to not even execute on my tests…)

GetComponents(NetworkView)*.RPC()*

as written on the official documentation that could be useful in your case.
http://unity3d.com/support/documentation/Components/class-NetworkView.html