// Use this for initialization void Start() { Debug.Log("Warning: If you see this debug message, make sure to maximize on play. OnBecomeInvisible(for bullets) will not work properly without it."); time = 0; levelDuration = 10; //testCode StartCoroutine("spawnEveryTen"); GameObject InitialPlayerGO = Instantiate(enemyPrefabRoot.Find(ENEMYTYPE.simplerobot.ToString()).gameObject); InitialPlayerGO.SetActive(true); PossessableEnemy pEnemy = InitialPlayerGO.GetComponent <PossessableEnemy>(); pEnemy.placeAtCoordinates(Vector2.zero); player.transform.SetParent(InitialPlayerGO.transform); Player playerScript = player.gameObject.GetComponent <Player>(); playerScript.setControlledEnemy(pEnemy); playerScript.playerHealth = 100; //FIXME: Hardcoded value }