void doTheAttack(Vector3 target) { bool shoot = true; if (shoot) { theWeapon = GetComponent<Weapon>(); if (theWeapon != null) { theWeapon.doAttack(false, target); } } }