1.ALWAYS -> set unitCount to 0
___for each obj ->add 1 to value unitCount
Make sure to set unit count to 0 every frame with the "always", as shown.
I call this type of setup a flush variable, because they never keep their value for more than 1 frame. Event order will matter greatly when using these, because you have to make sure your events which reference unitCount take place after the variable is "filled", otherwise it will just always return zero. Hope this helps!