Download

Transform with timeline from *current* location?

Hey guys,

Wrestled with this one last night, but couldn’t figure it out. Found a few posts on here about it, but I still wasn’t able to crack it.

I want to animate a sliding door. The door mesh exists within the blueprint. Below is the best I could get working.

a010dcea896e977b4a71df70dfd22db4ebd57887.jpeg

Now, this works; but I want to reuse the blueprint. Which means going in and changing location for each copy of it.

I know there must be a way to move a blueprint relative to its current position. But I can’t figure out how to set that up. (I assume I would use a vector graph and just translate along x, and add it to the current position).

Help?

You could use a AddRelativeLocation node, but you would have to change how you use the timeline as it would be adding the amount every frame.

Otherwise you could so something like this. By storing the original location, and getting the target location by adding how much you want to translate. This way the only variable you have to change is how much you want it to move.
sVudWHO.png

Using AddRelativeLocation:
4e06fae06fd714a68e856bf039ccac1d3f4a1d90.png

However, I’m not sure if that is a good way to do it as I don’t know if timelines will be affected by framerate. There is ways around that problem too though.
Here the length of the timeline will control how far it translates, as well as the vector value. This is added on tick.

Vector math is your friend.

Set the end point vector to: GetCurrentLocation + (getRightVector * distanceDoorShouldTravelToBeFullyOpened).

This way, whenever you clone your sliding door blueprint, you only need to change the distance door needs to travel to be fully open variable. And only if you ever need to make it travel further to open.
*
Note: distance door needs to travel is a float. And getRightVector assumes the door slides rightwards. If its left, just use a negative value for the multiplier, if its upwards use getUpVector.*

This is what I put together from your description:

2.jpg

The door is moving, but not correctly :confused:

Not sure if the ‘GetWorldLocation’ is the correct node (seemed to make the most sense). Also, I’m confused by the multiply - shouldn’t I be adding the forward vector amount to the current location? I want to move 70 cm, if I multiply by that amount, the door is flying clear away. Right? Maybe I don’t understand how vector multiplications work (and by “maybe”, I mean “probably”). Anyway, 0.7 gave me the closest result. I’d prefer to put in the actual amount in cm though.

Also, the timeline isn’t flipflopping correctly. In my setup it works, but done this way the door just keeps moving in the same direction each time you click it - no back and forth.

Its cause your using the set relative location node. As a rule of thumb, pick relative or world space and stick to it.

Imagine your door is in 1000,1000, 0 WORLD space. If you plug that into RELATIVE space, your door will fly 10 meters away from the parent.

As a last note, the door IS moving backwards. Its just that after the first time you fire it, its starting location is being set to the relative equivalent of its world space.

Thanks again!

Okay, I’ve updated my graph with just world space. I tested my outputs with print string, and they are working with this vector math (traveling 70 cm in Y).

However, when I plug in the setworld location, my door is sailing away. It’s moving way more than 70 cm. I’m assuming the timeline is repeating the move on each tick - or something likethat - instead of just executing it once. Any ideas?

75fdc3aad0a222328ae891d3ecd111ba9e6a3cbb.jpeg

You are getting the updated world location each frame and it is adding to that, you need to store the original location like I showed in my post above.

Sorry, Morsel3y. I went went off track and neglected that part. Back on track and it’s working as intended. Thanks!

Or… you can use ‘SetRelativeTransform’