how can I link objects and when I drag some object of them all linked objects should move with the dragged object?
There’s a “Sticker” extension for sticking one object to another that might help:
https://wiki.gdevelop.io/gdevelop5/extensions/sticker/reference
well thanks … it didn’t work… no problem for this time I solved it by changing the position for the second object when I drag the first object
It should work, which means you may not have used it correctly. I suggest you try again as there are no extra events to create to keep the objects together and it will keep the same relative position when rotating the first object.
Remember you need to load the extension, add the sticker behaviour to the second object, and then stick the second object to the first (only once, either in your “Beginning of scene” event or when the second object is created)
I tried it but I don’t know what’s wrong … can you set action and behavior types for the first and second objects here? I would be thankful.
Here’s how it works:
-
Add the sticker behavior to the object that is NOT being dragged. In my example, Newsprite has the
Draggable
behavior and my Newsprite2 has theSticker
behavior. (you can check or uncheck theonly follow position
box. -
Add an event like this:
YES, now it works well that is why I asked to set an event … because I thought it needs to be linked between objects … thank you very much