void ChooseAction() { HandleTurn myAttack = new HandleTurn(); myAttack.Attacker = thisEnemy.getName(); myAttack.Type = "Enemy"; myAttack.AttackerGameObject = this.gameObject; myAttack.TargetGameObject = CM.HeroesInBattle[Random.Range(0, CM.HeroesInBattle.Count)]; HeroToAttack = myAttack.TargetGameObject; myAttack.Target = HeroToAttack.GetComponent <PlayerStateMachine>().Ashus.getName(); int tempNum = Random.Range(0, thisEnemy.getSkills().Length); myAttack.choosenAttack = thisEnemy.getSkill(tempNum); Debug.Log(thisEnemy.getName() + " has chosen " + myAttack.choosenAttack.getSkillName()); Debug.Log("The number rolled was " + tempNum); CM.CollectActions(myAttack); }