I am working on a small prototype 1 versus 1 fighting game and I want to detect which character is getting damaged during combat.
Each of the characters is in the same family I labeled as "Fighter", the reasoning was so I could create the combat logic once for the family instance and it would work the same regardless of which character was fighting. The issue I have come to is during the interaction between two instances of the "Fighter" family.
Currently my logic asks if one character is in the ATTACKING state AND is overlapping another "Fighter". If this is true I want the other "Fighter" to go into their DAMAGED state.
My question is, how do I identify the other "Fighter" that needs to be damaged? Because they are in the same "Fighter" family, I am not sure how to distinguish one from the other in the logic.
I am hoping someone here may have come across this already and could share some insight on the correct solution.