void OnZeroHealth() { beam.transform.parent = null; beam.offsetRate = new Vector2(velocity.magnitude / 25f, 0); beam.enabled = true; beam.GetComponent <TimeToLive>().enabled = true; Destroy(gameObject); }