Hi.
I would like to create a script that would move objects with the mouse. At the same time, I would like the objects to be able to merge with each other.
but I don’t want them to be one object.
I want objects to detect each other.
i’d try checking if can get collision events (this can fail, if move object fast by setting transform.position, it breaks physics)
if it collides, then parent that collided object as a child of the currently dragged object,
then it would automatically follow it. (and then unparent on release)
I would rather create a common parent, then parent all object to that common parent. Ie on collision, check if any object as a sticky parent, if not, create one, if yes parent to it, if both have delete one and parent to the other. It will simplified management of many collider and query, and potential bug down the line if you aong chain of children.