void CreateHitBox() { // need to check if destoryed later..no errors on playtime! hitBox = new GameObject().AddComponent <HitBox>(); hitBox.gameObject.name = hitBoxName; hitBox.transform.parent = this.transform; hitBox.transform.position = transform.position + transform.right; hitBox.transform.rotation = this.transform.rotation; hitBox.InitializeHitBox(damage, LayerMask.GetMask("Player")); }