I’m using a timeline to move an actor over the period of 2 seconds. I accomplished this by setting the timeline to run for 2 seconds, added a float key of 0 at 0.00seconds, and another of 1 at 2.00seconds. Then I used each update as the alpha in a Lerp to get a location between starting and ending position.
This works fine, but I’m having difficulties figuring out how the length of the timeline works and how it affects keys. EG: If I “Set New Time” to 3 seconds, how do I get the key to automatically change from 1 at 2.00seconds, to 1 at 3.00seconds?
I’m not 100% but i think the ‘set new time’ function actually just jumps the current location along the timeline to that time, rather than change the length of the timeline.
What I have done when I wanted something like you’re trying to do, is create a timeline of duration 1 second, with value going from 0-1. You can then grab a reference to the timeline and use the ‘set play rate function’ to change how fast it runs. Set play rate to (1/desired duration) and you’ll get what you want. So in your case, if you have a timeline of length 1 second, and set the play rate to 1/3, you’ll get a timeline that now takes 3 seconds to complete.
I’ve only used this with linear float tracks though, I haven’t really needed to do anything else with it, i’m not sure if there’s a way to move keys in code like you’re after (but i haven’t really looked either).
Just thought I would chime into this old post as well but first off thanks as this worked well for what I was needing to use it for and it makes reusing already existing timelines. So I made a visual reference as to how I set up one of the instances of the timeline to resale base on a time of minutes if anyone in the future may run across looking to do the same thing.