Out of curiosity: Why do you use UnitRefFromVariable over UnitRefFromUnit? The latter should not have any problems whatsoever with an array variable.
The only reason to pick UnitRefFromVariable I could think of would be, that it updates the unit reference to the new unit, if you change the variable dynamically (does it? just guessing here), but that would cause your current solution to malfunction, wouldn't it?

bradosia Regular Shmoehello, I am using triggers for the most part but I have a custom script snippet in my code for the "TriggerAddEventUnitProperty" functionality.
My script looks like this
The "gt_hb3" trigger has only has one event: to say "hello world" in chat.
The problem is that the trigger will activate when ANY UNIT changes health. Now the reason I come up with the assumption that arrays don't work is because when you use a regular variable in the add event function:
Now the code works... I don't understand how to make arrays work in add even function.
What I'm trying to do I'm trying to create a custom boss bar. I have a function that when called will create a boss bar user interface component on the screen. The function will also add an event (Unit property changes) to a trigger that updates the custom boss bar. The function creates a boss bar for any unit that contains health, shield, energy, experience, level, name, and portrait information which is why I don't just use the pre-made boss bar. This is more like a unit status bar.
I would really like to use an array, but if all fails I guess I'll have to make many variables.
Thank you for your help.
BTW, the reason I need arrays is to create a unit bar for each player like so:
never-mind I fixed it immediately, I simply put the array value into a temporary variable and used that.
here is the fix for the code in the very beginning:
I hope this helps someone else.
EDIT: THE SOLUTION I POSTED DOES NOT WORK, READ MY NEXT POST! I STILL NEED HELP.