Jump to content
Search Community

Change property values in existing timeline

swampthang test
Moderator Tag

Recommended Posts

I understand that function-based values only run once - when the tweens in a timeline are created. I'm trying to figure out how to update property values in an existing timeline. In the codepen, I have speed and distance fields from which the duration and x properties are taken. I'd like to be able to make changes to the fields and have the property values change based on whatever is entered into the field while the timeline is running. 

 

I've looked at the invalidate() method but trying to figure out how that would work while the timeline is playing.

 

Is this not possible? ANY way of achieving this?

See the Pen yLzMdpW by swampthang (@swampthang) on CodePen

Link to comment
Share on other sites

Thanks, Blake. I had just finished this version about the time you posted this except for the progress reset step. Glad to see I was on the right track.

See the Pen bGoWbde by swampthang (@swampthang) on CodePen

Thing is, I have to kill all the tweens and rebuild them whenever tween durations change because, even though the tween durations change, the timeline keeps the same duration according to the GSDev timeline. I can see why durations would call for that kind of treatment though, unless you have some thoughts about how that could work as well.

Thanks again, as always.

Edited by swampthang
clarifying
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...