0
\$\begingroup\$

I have a simple static mesh attached to a scene in a blueprint. I want to move the component back to (0,0,0). If a component is not attached to any other component other than the default scene root, I just type in (0,0,0) as the Target Relative Location.

To be precise, I don't want it to go to (0,0,0) but head there and stop, so I just give it the world location and then multiply X, Y and Z by 0.67 (could be any value).

But now I have a few child components attached to an extra scene. This scene is moved (-2460, 3070, 2600). Now to make matters worse, it's ALSO rotated (0°, 0°, 90°) and every component I try to move is ALSO rotated by (0°, 90°, -90°). The numbers themselves aren't hard to crunch but I have no idea what "Target Relative Component" should be now.

I tried adding vectors, subtracting vectors (both relative and world from both the parent and every child component I want to move), inverting transforms, transform directions, rotating the resulting vectors, unrotating the resulting vectors, nothing seemed to work, at least not the combinations I tried.

How do I get the correct Target Relative Location?

\$\endgroup\$

1 Answer 1

0
\$\begingroup\$

There's a method (a.k.a. "node" in Blueprint lingo) called Move To World Position, where I can define the exact point where I want my element to be. To get a smooth transition I discovered Timelines (duh, right - but I'm new to UE4) so that problem is solved: Create a float track in the timeline, then connect the float pin to a "Lerp (vector)" node and set the Lerp A pin to the current world position and the B pin to where you want it to be. Then the lerp vector output goes to Move to World Position.

Works with relative positions too.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .