|
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?
(comments are locked)
|
|
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);
(comments are locked)
|
