// Choose a random target for the attack void RandomAction() { HandleTurn myAttack = new HandleTurn(); myAttack.attacker = enemy.name; myAttack.attackerType = "Enemy"; myAttack.attackerGameObject = this.gameObject; myAttack.attackerTarget = BSM.herosInBattle[Random.Range(0, BSM.herosInBattle.Count)]; // Selects a random target from the Hero list BSM.StoreActions(myAttack); // Sends attack info to the BattleStateMachine StoreAction function and performList list variable }