blackhornet , so you can't pick UID by one group and alter by another. Felt like it shouldn't make any difference, since an UID is always same no matter what family the object is in. Oh well... back to the drawing board.
So if you filter out (is on screen, is moving) ONE object in group 1, and you feed the UID of that one object to the function, then all you got to do in the function is pick by comparisation > object = group 1 or 2 (does not matter) expression = group.UID ... value is the parameter .. operator ><. And do your stuff in the actions. Because all but that one with that UID will be in the picklist in the function. A function ALWAYS starts picking from scratch.
But, i suppose 'is on screen & is moving" does not pick ONE object, but a bunch of objects. So in the picklist there are more objects. Looping trough those and it feed them one by one to the function will not solve it. Because the first index in the loop will select other objects then the next index in the loop, and in the end you see only what happend compared to the last object in that bunch of objects.
The solution here is not use a function. But think the other way arround. Pick straight.
Condition > invert the 'on screen'
Condition > invert the 'is moving'
Now you have everything picked that you wanted to pick. Do your stuff in actions.