Skip to main content
5 of 5
Cleanup
DMGregory
  • 140.8k
  • 23
  • 257
  • 401

Detect Child Trigger inside Parent Script

I want to detect when a Child's collider is being triggered to apply the damage to the thing being hit. But currently I'm confused about how it works.

Does the Parent's OnTriggerEnter detect the trigger events of the Child Object ? And how do I know the trigger come from the Child and not the Parent, and know which Child's collider got triggered?

The Parent's collider is not a trigger, but the Child's collider is.

Enemy sprite attacking, with collider outlining the hit area of the attack

Thien
  • 13
  • 1
  • 4