Question by
chrisbatey971 · Feb 28, 2019 at 01:49 PM ·
scripting problemcollisioncollision event
Collider with more health wins collision? Please Help!
Sorry I don't have a specific example or if this is simple but I basically have colliders (like cannon balls) that fly at each other. When the collision happens the health of each is compared, if ball one has 120 health and the ball two has 90, i want ball two to be destroyed (this part I can do) and ball one to continue flying in direction specified with 30 health.
So all that being said, how do I make sure that when a collision2D happens that the objects can check the colliders health (part I can't figure out) as well as each of them subtract their health's from the other.
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612192646im_/https://answers.unity.com/themes/thub/images/avi.jpg)