when i connect to a server, the player is created on the client and the client can move the player as expected and it is viewed as moving on all other clients and on the server view.
when the client window is closed i destroy with network.destroy(Player) to destroy it across the server. and it works as expected. the player object is no longer visible on any other client or server.
when the game is started up again, the player is created on the server and all clients and moves as expected.
however, only visible on the newly opened client is a copy of the player created with the newly created one. this copy has no controls because it does not belong to the client i assume, but i have no idea why it creates the extra. and if that window is closed and a new client opened, there are 2 dead copies created on screen along with the working player. and it keeps adding to it until the server is reset.
void OnConnectedToServer(){
if (Network.isClient && !HasSpawned) {
Player = (GameObject)Network.Instantiate(Cube, new Vector3(0, 0, -5), Quaternion.identity, 1);
PlayerCamera = (GameObject)Network.Instantiate(Camera, new Vector3(0, 0, -10), Quaternion.identity, 1);
PlayerCamera.GetComponent<Camera>().enabled = true;
//i enabled all other player camera features below this enable
Player.GetComponent<DestroyClientPlayer>().player = Player;
Player.GetComponent<DestroyClientPlayer>().playerCamera = PlayerCamera;
Player.GetComponent<CubeMove>().enabled = true;
Player.GetComponentInChildren<TextMesh>().text = PlayerName;
GetComponent<Camera>().enabled = false;
GetComponent<Menu>().enabled = false;
HasSpawned = true;
}
}