void OnTriggerEnter2D(Collider2D other) { if (shouldDelete) { return; } if (other.gameObject.CompareTag("Player")) { string sceneName = SceneManager.GetActiveScene().name; BattleInfo battleInfo = new BattleInfo(sceneName); Enemy[] enemiesInGroup = GetComponentsInChildren <Enemy>(); foreach (Enemy enemy in enemiesInGroup) { battleInfo.Add(enemy.getEnemyID(), enemy.unit); } BattleSystem.currentBattle = battleInfo; LoadNewArea loadArea = gameObject.AddComponent <LoadNewArea>(); loadArea.sceneToLoad = "BattleArea"; loadArea.LoadArea(); } }