How do I know how many objects are present in a given point?

how do I know how many objects are present in a given point?

Hi guys I have a problem that is making me crazy. I have an object that by dragging you go to position X, Y if another object goes to the same position they change. The problem is that when the game starts in position X, Y is free so I’m not going to make any changes. Ps (The items to be changed are part of the same group)

You can try a loop of all items in the group and compare the distance to the destination point then you check if distance is < 1px they are in the same point.

–Foreach items ot this Group
------ Compare distance to this point
--------if this item distance to this piont < 1px
----------- do something

1 Like