using UnityEngine;
using UnityEngine.Networking;
using System.Collections;
public class TestNetworkManager : NetworkManager
{
public GameObject testPrefab;
public override void OnServerAddPlayer(NetworkConnection conn, short playerControllerId)
{
GameObject proxyPlayer = (GameObject)Instantiate(playerPrefab,playerPrefab.transform.position,playerPrefab.transform.rotation);
GameObject test = Instantiate(testPrefab);
Debug.Log(playerControllerId);
NetworkServer.AddPlayerForConnection(conn, proxyPlayer, playerControllerId);
ClientScene.AddPlayer(conn, (short) (playerControllerId + 1));
NetworkServer.AddPlayerForConnection(conn, test, (short)(playerControllerId + 1));
}
}
Which seems to work. Both gameobjects are spawned on the client with isLocalPlayer set to true. I just have to do a bit more work to wire everything correctly on the client and on the server. I will probably do it with