public override void launchAttack() { target = null; Debug.Log("DEBUG: LaunchAttack Single Target"); RaycastHit hit; if (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out hit, Mathf.Infinity, UnitHandler.currentEnnemyLayer)) { Debug.Log("AttackConnected!"); Debug.Log(hit.collider.transform.root.gameObject.GetComponent<UnitBase>().uName); target = UnitHandler.units.Find(x => x.getId() == hit.collider.transform.root.gameObject.GetInstanceID()); target.printName(); //If we have an active unit and an active target if (!(Equals(UnitHandler.unit1, null))) { //Unit 1 attacks his target setTargets(Effector.getTargets()); if(target!= null) UnitHandler.unit1.attackUnit(target, this); endAttack(); } } }