[SOLVED] Moving multiple objects while keeping their relative positions?

How can I move multiple objects in a way that maintains their relative positions to each other when one of the objects is moved? For example, if I have several objects positioned in a scene, when I move object1, I want every other object to move the same distance and direction while preserving their relative positions in relation to one another, akin to a “put around a position” or moving the camera of given layer around.

Solutions from comments:
Thanks to @7ToGo @ZeroX4 @MrMen

Using Sticker Extension

The method of moving objects in a game depends on the desired outcome. If an object is dragged, it may result in lag. For top-down or platformer behavior, applying the same movement to other objects simultaneously can be achieved by grouping them. This grouping simplifies event referencing for collective actions. To ensure all enemies move in the same direction as the player, grouping enemy objects (e.g., Goblin, Zombie, Skeleton, Slime) under “Enemies” allows for unified control. However, a challenge arises with increased object count, demanding more performance.

Alternatively, objects can be moved by applying force toward an angle or by directly modifying X and Y positions. Each approach has its implications for game performance and responsiveness.

Try using “Sticker” extension.
Screenshot_3

1 Like

That depends how you move your 1st object
If you drag it then it will be laggy
If it is topdown or platformer behavior then you give same behavior to other objects and while 1st object is moving you simulate same movement for other objects
To address other objects as one in events you put them in group and simply reference to that in events
So if you want all enemies to move in same direction as player
You put your Goblin Zombie Skeleton and Slime objects into group called Enemies
And now you address Enemies and not each object individually

Another problem is more objects = more performance needed

Another way to move is add force toward angle
Yet another to add to X and Y pos of Enemies or subtract from them

1 Like

As @7ToGo wrote, use the sticker extension. Here’s an example of how to do that.

Stick all the objects to the one that moves, and they remain in place relative to the moving object, even when it rotates. There’s no lag, no need to move any of the other objects.

1 Like