I'm working on a fighting game, and rather than duplicate the code for Fighter1/Fist1/HealthBar1 to have 2 (or more) fighters, I'm trying to leverage families, with objects being picked based on them having the same PlayerNumber instance variable.
I have this mostly working, but there are 2 particular situations where I'm running into a lot of issues.
Here is where I'm trying to put the Fists and HealthBars at the right spot for each fighter, as well as resize the HealthBar appropriately. The stuff referencing Fist1/Fist2/Fighter1/Fighter2/Health1/Health2 is what I currently have working.
The stuff below just referencing Families does not work correctly (both Fists and HealthBars are stuck on Fighter1, while Fighter2 has nothing). It looks like the issue is that the Event is not correctly picking a Fighter instance, and so the Action just refers to the first Fighter it finds.
Here is where I'm detecting active attacks, and calling Damage appropriately. The top stuff referencing Fist1/Fist2/Fighter1/Fighter2 is what I currently have working.
The stuff below just referencing Families does not work correctly (whenever either Fighter attacks, the other takes damage regardless of proximity to the former's fist). I think this is a similar problem to what I explained above, where the action is not using the same fighter that's referenced in the event (basically, Fist1 is always overlapping Fighter1, and then a different Fighter is found with a PlayerNumber separate from the Fist, and so that Fighter gets Damaged).
I have workarounds, and there are other things I could do differently, so I'm not trying to solve the problem so much as understand what's causing it. It's frustrating because Construct 2 is normally so automagical with Instance Picking, but that functionality seems to completely fall apart when dealing with families.
Any clue what I'm missing here?
Thanks!