Announcement

Collapse
No announcement yet.

How to change timeline duration and have updates relate to new time?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to change timeline duration and have updates relate to new time?

    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?

    Unpopular Minion on the Play Store (Released: January 31, 2016)

    #2
    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).

    Comment


      #3
      I'll give that a shot and let you know. This may just work.

      EDIT: Worked PERFECTLY. Thank you!
      Last edited by Distul; 02-19-2016, 04:22 AM.

      Unpopular Minion on the Play Store (Released: January 31, 2016)

      Comment


        #4
        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.
        Attached Files
        Last edited by KyleDail88; 07-26-2017, 04:19 PM.

        Comment


          #5
          Thanks Guys.
          You Guys are Angels

          Comment


            #6
            Very useful BP for setting speed. As a side note for others, You got the timeline as a target by dragging it in the BP and choosing Get.
            Last edited by Karrelen; 10-07-2019, 07:52 PM.

            Comment

            Working...
            X