Spawn 1 child to 1 parent object

basically, I spawn a lot of object 1 and object 2, I want object 2 to be object 1’s child and have a 1:1 ratio of these how do I attach them once I spawn them both? (they are in the UI layer)

are you talking position or size?

1 Like

just to attach them so I can send a message to it (send to all attached objects)

to do that you would have to end a message to all object 2s not all attached objects just make sure not to specify an object just type

1 Like

I’m making an inventory and object 2 stores the amount per slot and object 1 send it (I have an idea I’m implementing rn where it checks its position and marks its slot number as that, then I would have object 1 send to all object 2’s then if they are the same id it would pass) but that’s a bit laggy I was hoping to be able to attach them

have you tried an attaced block but that would make the positon the same

nvm, thank you the comment above sparked an idea!

No problem happy to help

You can also send a message to last contacted object, so it will send a message to object 2, which is touching object 1.

I thought collisions don’t work in the UI layer?

oh maybe it doesn’t I don’t use the UI layer a ton

I mean, you can still send to the last contacted object in the UI layer, but you can also send to all attached objects even though you can attach things to it.