title: Unity Client and Server
body: <p>In Unity4.
  I'm making a network client and server.. Two different unity types.
  The client is the actual game, the server is a separate plain server.</p>
  
  <p>I don't quite understand what an RPC is. I understand that it is essentially a function called over the network, but how do I use it?</p>
  
  <p>I have to instantiate the object new prefab.. Whenever I look at a tutorial it tells me to do this: transform.position</p>
  
  <p>What is transform.position, isn't it my position?</p>
  
  <p>How do I connect to the server then have my position updated? How do I get other people's position?</p>
  
  <p>My idea was in the update of NetworkManager I would call an RPC to move the player to new position if it's not the same as the old one?</p>
  
  <pre><code>Network.Instantiate (PlayerController, transform.position, transform.rotation, 0);
  </code></pre>
  
  <p>transform.position?</p>
  
  <p>PlayerController is the FirstPersonController put into a prefab and renamed..</p>
  
  <p>What do I need to make on the server part of it? The server is basically just a connection between all the clients, do I even need the RPC function on the server?</p>
  
  <p>When someone connects, how do I get it so the server tells everyone that someone connects and how do I send that person who just connected the positions of all the new players?</p>
  
  <pre><code>void Update () {
      Transform newPos = Network.player.transform;
      if (oldPos != newPos)
      networkView.RPC ("UpdatePosition", Network.player, 
  }
  
  public void OnPlayerConnected(NetworkPlayer player){
      Network.Instantiate (PlayerController, transform.position, transform.rotation, 0);
  }
  
  public void OnPlayerDisconnected(NetworkPlayer player){
      Network.RemoveRPCs (player);
      Network.DestroyPlayerObjects (player);
  }
  </code></pre>
  
  <p>That is the client so far.. I need the UpdatePosition to update that single player's position on all screens..</p>