Using Network.Instantiate called from OnConnectedToServer(). I have a NetworkView attached to the prefab. Prefab and spawnpoint dragged to public vars via inspector. Client connects to server but spawns prefab on itself only. This seems so simple but I just can’t make it work. I have read every single topic on this over and over and most get it to work on the server but not on the client. I even seem to be using the exact same code. 2 days of this is driving me nuts please help.
var playerPrefab:GameObject;
var spawnObject:Transform;
function OnConnectedToServer(){
Debug.Log("Connected");
yield WaitForSeconds(1);
spawnPlayer();
}
function spawnPlayer(){
Debug.Log("Spawning player ... please wait");
Network.Instantiate(playerPrefab,spawnObject.position,Quaternion.identity,0);
Debug.Log("Player spawned ... play game");
}