private void OnTriggerEnter(Collider other) { if (other.transform.root.CompareTag(Target_tag)) { bodypart_script = other.GetComponent <Bodypart_Damage_Manager>(); parent_script = other.GetComponentInParent <Chara_Damage_Manager>(); if (bodypart_script != null && parent_script != null) { if (!Damaged_targets.Contains(parent_script.transform.gameObject))//Check if the hitbox already hit the target's other bodyparts. { Damaged_targets.Add(parent_script.transform.gameObject); OnHit(other); } } } }
// Start is called before the first frame update private void Awake() { parent_damage_manager = GetComponentInParent <Chara_Damage_Manager>(); }