So I’ve tried using onClientConnect in order to have this:
public override void OnClientConnect(NetworkConnection conn) {
ClientScene.Ready(conn);
Object[] allObjects = Resources.FindObjectsOfTypeAll(typeof(GameObject));
foreach (GameObject go in allObjects) {
if (go.tag != "NetworkPlayer") {
EnemyController.AddPlayer(go);
}
}
Debug.Log("test");
//ClientScene.AddPlayer(0);
}
I have took part of this code from a guy that helped me.
I’m not sure what the ClientScene.AddPlayer(0) server here thus I set it as a comment.
“p” is a list of gameObjects of players and the method AddPlayer() in EnemyController adds to
the list another game object. the Debug log hasn’t worked and I’m trying to get the list
of the players unsuccessfully please help me