Download

Rotate an object using realtime secnonds and user defined time.

Hi there,

So I was using a timeline node to and move objects. But I realized that I would rather have the ability to set the time it takes to get from point A. to Point B. It seems I can’t do this with a timeline node as the time is set in it. Also after having tried to multiply or even add time to the output of the curve float from the timeline.

I also can’t use delta time. This leaves me with I believe realtimeseconds. So how can I go about using that with a custom time input and a custom curve to set how long it takes for the actor to finish its transformations (rotate, scale, move)?

Cheers!

You can still use the timeline to move the actor though to be honest I’m not sure how a real programmer or designer would think about the technique.
So you have a specified time it should take a actor to go from A to B, were A is 0% traveled and B is 100% traveled. By setting the timeline length set timeline length* you can define the time it should take, and as you play the timeline, you divide the current playback position get playback position with the timeline length get timeline length to get the percentage played.
Then, multiply whatever transformation you are doing by the percentage.

I am not sure what you mean by “The time is set in it”. If you add a float track with one key at 0,0 and one at say 100,100 you can easily access the current ‘time’ of the timeline.

*One thing to note is that if you have played a timeline and then reduce its length, the update node will fire even though it is not playing. That may be a bug, I don’t know but you can solve that by doing a check after the update node to see if the timeline is playing.

Hey thanks for the reply!

Yeah so I am using the timeline node already. Inside there you can set the length and the curve. But on the blueprint I rather have an exposed variable where the designer (myself actually) can set the time to something different than what is set on the timeline node.

This is what I currently have. So I know “in” that timeline I can set a length and curve. But again, I want to be able to set a custom time, rather than the “set time” inside that timeline node. I tried using the “new time” but I think either it doesn’t work or I have no idea how to get it to work haha.

What do you mean by set timeline length?rotate.PNG

You can set the timeline length during runtime, with the set timeline length node. It may be 1s when you start the game, but then later change it to be 5s or whatever.

The reason the “new time” is not working for you, is because you are playing from start. Well, at least in the screenshot. In order to use a new time, set the time and “play”, instead of “play from start”.
In order to access the timeline nodes you need the timeline reference. It’s hidden under the components category.

Reaaaaalllllyyy? Let me fiddle around with these. I didn’t catch these before. A more experienced person I know said what I was trying to do wasn’t possible with a timeline node. Maybe he didn’t know of this stuff. I will give what you are suggesting a try.

I am not sure how I get the timeline node to be a variable though. Forgive me. I am pretty darn new to blueprints and learning as I go haha.

Thanks thus far this input. =)

The way Ive always done this is to set the time in the timeline to be 1 second long, and then in the construction graph, I set the playrate of the timeline to whatever I want via a variable which allows you to alter how long the timeline takes.

Huh ok, that makes sense. Let me see how that works for me. I think I know how to set that up exactly.

So I did just try this. I have the construction script doing a “set play rate” and then the target is the timeline node, and new rate is my exposed time variable. Setting it to .5 makes it not finish the rotation from point a to b. Setting it to a high value makes it go SUPER fast and finish from point a to b.

Ok. The play rate works for the most part. I had a function still plugged in that was breaking it before. Once I pulled that it was running as expected. 0-1 second default with a playrate set to .1 made it run at 10 seconds.

Glad you were able to get it working. As a tip, I always divide 1 by the time variable so you can keep the variables units in seconds (so you dont have to do any math later on for a longer times).

HAHA, got back to me with that one a little late. I was trying to figure that out. Math isn’t one of my strong points. Which will make the whole BP experience for me that much more frustrating I think. lol

Now I am just trying to figure out how I can let the user (designer) choose which order the timelines play via variable.