[SOLVED] How to detect overlapping objects in a group of the same name and remove one of the two overlapping

I have an object group. I want to make sure that the objects in this group placed in the scene never overlap each other if they have the same name by deleting one of them.

For example, if Object1 from a group collides with an object from the same group and has the same name (Object1) then one of them should be removed.

It would help if we knew what the objects represented. How many object types are you using? When are you checking for matching objects? It would be easier to do if you checked after each object is added.

Sprites. I check after all of the objects are created and in place.

I’m clueless. I have ideas but nothing specific.

You can reduce the pick list with
Group is in collision with group
You could then use a for each object to check for either colliding objects or objects by distance. You could variables to save the x, y and maybe an ID and or object name. Or search 1 object type at a time.
That part I’m unsure of. IDK if the best way would be to use an array or place checker objects. I just don’t know. Maybe nested for each objects events. IDK.

I solved this by looping for each object and make sure that the object name isnt the same as object being placed. This only works when a creation of an object is being done. It could be adapted to work always.