How to move an actor along another without attaching

Hi everyone,

So I have a building system built entirely with blueprints, this system allows player to place, move and delete objects selected from a menu. I recently started adding multi-selection and the operations that come with it, I got scaling and rotating working but somehow I can’t figure out how to deal with location. For rotation I use a simple function to rotate a vector using the rotation delta my gizmo gives, but I can’t figure out a function or a mathematical answer to applying a location to multiple actors.

Basically what I would need is to get the last object in my selection array and all the other actors need to follow the delta that this object uses, I tried using add local/world offset but it uses the delta on a per object basis, which makes my objects move all on their own local spaces.

Hopefully that was clear enough.

Thank you all!

1 Like

Or you could cheat and attach them for duration of the move. Detach when done. The same actually goes for rotations.

The question is whether you want a solution or a math solution.

Unfortunately attaching and detaching breaks the whole system for reasons I cannot change, the plugin I use for the gizmo gets confused with attached object that’s why I was asking for a solution without that…

1 Like

A world move is a world move. You can move them all in the world, surely?

Yes I can, it’s when I use local that it gives the delta on a per object basis, basically I would need the selected object to “become” the world center for all the other selected objects and apply the delta based on this, or as I said apply the delta based on the local space of the last selected object, would the “transform location” work for this, I’ve seen it in the math library but I’m not sure of its usage

I know how it works, but can’t quite get your situation clearly enough to understand how to apply it.

You’re moving object A locally, and you want to know what that is for object B ( either locally or world )?

Yes, moving object B (and all the others) along object A, so when object A receives +10 on the X axis I need to convert that for every object so that they have + something on the required axis based on the rotation of object A and their own rotation, technically using object A’s local axis as the world axis for every other object, if that makes sense, I’m sure there’s some simple or complex maths to calculate the distance and all but I’m no math genius…


Here, the vector is the delta given by the gizmo, it’s always +10 on the X Y or Z axis or combinations of those like XY XZ YZ(grid-based basically but it shouldn’t matter)

Understandable. Was merely trying to get away with the minimal amount of work :eyes:

  • try this:

https://dev.epicgames.com/community/snippets/d3k/unreal-engine-move-actor-array-by-pivot

Build an array of local offsets and apply to the rest of the group when the pivot is moving.


And here’s the cheat for whoever else who wants to apply it:

Both deliver the same result.


Zipped project:

1 Like

I mean:

You need world for the other objects.

This can be done with transform location, too but I would not use transform direction as then you’d need get tick involved which may result in an inaccuracy. You may end up adding varying amount of offset. Perhaps it’s negligible.

I will try that and see

1 Like