Hi. Here's my code:
My problem is that it prints "Hit!" for every collider that the enemy has. My enemies have several colliders. How do I limit it so that it only applies the damage once per enemy?
asked Aug 17 '10 at 12:32 PM
What I'm doing is to search for a specified component In my case it's "DamageReceiverComponent" in a hierarchy. Starting from a collider.gameObject moving up (I do not search in children). Now I have got a list of DamageReceiverComponents, I remove all duplications and apply damage to unique ones. DamageReceiverComponent.ReceiveDamage(IDamage damage);
answered Jan 31 at 05:54 PM