New Unity 5.1 Networking :- Spawning is not synchronized!!!!

Hello,
I am a junior undergraduate student and I am new to UNITY and Game development.

I have problem spawning players in my game. I am using new unity Networking. I have set two empty gameObjects as StartPosition(New Network Components) in my Scene. When i connect either from client or server the local player gets spawned at 1st SpawnPosition and the other at 2nd SpawnPosition (although they appear correct in game). But it’s actually not like what i have expected. It appears that in both game application myplayer is at 1st SpawnPosition and the other at 2nd SpawnPosition. i.e spawning is not synchronized. Please help me through it. Thanks in advance.

here is what i am trying to achieve for my two player game…

public class Spawner : NetworkManager {
     public Transform[] spawnSpots;
     public override void OnServerAddPlayer (NetworkConnection conn, short playerControllerID)
     {
 
         if(isServer)//isServer doesn't exist
         {
             GameObject player = (GameObject)Instantiate(base.playerPrefab,spawnSpots[0].position,spawnSpots[0].rotation);
             NetworkServer.AddPlayerForConnection(conn,player,playerControllerID);
         }
         else if(isClient)//isClient doesn't exist
         {
             GameObject player = (GameObject)Instantiate(base.playerPrefab,spawnSpots[1].position,spawnSpots[1].rotation);
             NetworkServer.AddPlayerForConnection(conn,player,playerControllerID);
         }
     }
}

Sorry guyz for trouble, after a lot of debugging and study found out my noob mistake.

i was finding GameObject with name and turning his camera and controller on. But it always found the server player first and turned his controller and camera on. So it appeared that they spawned like that.

if your using UNET try this

using UnityEngine.Networking;

public class Spawner : NetworkBehaviour {

NetworkBehaviour derives from Monobehavior

then

if(isLocalPlayer){}

if(isServer){}