// Use this for initialization void Start() { Debug.Log("Create a Model"); player = Instantiate(Resources.Load("Prefabs/Player"), Vector3.up, Quaternion.identity) as GameObject; player.transform.position = new Vector3(0, 11, 0); player.name = "Player"; enemyFac = gameObject.AddComponent <EnemyFactory>() as EnemyFactory; enemyFac.GetComponent <EnemyFactory>().Attach(GameObject.Find("myData").GetComponent <SceneController>()); sub = player.GetComponent <Player>(); player.GetComponent <Player>().Attach(GameObject.Find("myData").GetComponent <SceneController>()); }