private void LateUpdate() { if (initialized) { if (CanMove) { if (target && target.gameObject.activeInHierarchy) { MoveTowardsTarget(); } else { target = parentLauncher.ClosestEnemy(); if (!target.gameObject.activeInHierarchy) { Destroy(gameObject); } } } } }