Compare XY Position of one group/family with another group/family

Long story short, I have a lot of objects and instances of objects in group_obj_unit_grey and group_obj_tiles.

When I do the following, not a single tile changes to occupied.

When I do this, only the top most tile that has soldier sitting on it changes to occupied.

I need a way to compare the XY position of every instance within a group (or family) with XY position of every instance within a group (or family).

And no - I don’t want to accomplish this through collisions - as it has other complications.

I am not sure but
Now you are checking if Tiles X/Y = Units X/Y
Switch it
Check if Units X/Y = Tiles X/Y

I found this with object linking where using repeat for each and take into account
Actually matters which is 1st in condition
Maybe it is same for you

2 Likes

The conditions are checking for x and y but they could be from different objects. The x of 1 object and the y from another object. It might be better to check them with 1 condition like collision or point is inside.

You could use point is inside. This uses 2 balls in a group and several tiles. I rotated the tiles for testing.

You could reverse the logic and check if the other objects are inside the tiles.

It might be more efficient to update the booleans as objects are moved or placed. It depends on the process.

1 Like