title: How to have a property add and sync when player spawn
body: <p>Have a bit of problem understanding how to have the property <code>theNumber</code> add and sync.</p>
  
  <p>1) I have two players</p>
  
  <p>2) When the players spawn I want <code>theNumber</code> to add one so each player report a different sequential number</p>
  
  <p>I just do not get it to work and would appreciate some help.</p>
  
  <p>The following code is placed on the players that are spawned.</p>
  
  <pre><code>using UnityEngine;
  using System.Collections;
  using UnityEngine.Networking;
  
  public class Player : NetworkBehaviour {
  
  [SyncVar] public int theNumber;
  private int _nr;
  
  public override void OnStartLocalPlayer () {
      print ("OnStartLocalPlayer");
      _nr = theNumber;
      CmdX (theNumber);
      DoCalc ();
  }
  
  [Command]
  void CmdX (int myInt) {
      print ("theNumber: " + myInt);
  }
  
  [Client]
  void DoCalc () {
      _nr++;
      CmdPrint (_nr);
  }
  
  [Command]
  void CmdPrint (int nr) {
      theNumber = nr;
      print ("CLIENT CONNECTED WITH THE FOLLOWING NUMBER: " + theNumber);
  }
  
  }
  </code></pre>