gareth Posted November 29, 2020 Share Posted November 29, 2020 Is it possible to refresh random values on every repeat of a timeline? I have the the random values on each tween creation, but it just loops the same values. See the Pen BaLyqbb by garethj (@garethj) on CodePen Link to comment Share on other sites More sharing options...
akapowl Posted November 29, 2020 Share Posted November 29, 2020 Hey @gareth repeatRefresh might be what you're looking for See the Pen 7bc9f4a88180f4a147869a0e8f7e6153 by akapowl (@akapowl) on CodePen repeatRefresh Setting repeatRefresh: true causes a repeating timeline to invalidate() all of its child tweens and re-record their starting/ending values internally on each full iteration (not including yoyo's). This is useful when you use dynamic values (relative, random, or function-based). For example, x: "random(-100, 100)" would get a new random x value on each repeat. duration, delay, and stagger do NOT refresh. (from the docs) 6 Link to comment Share on other sites More sharing options...
gareth Posted November 29, 2020 Author Share Posted November 29, 2020 ok wow, so simple - thank you ! 1 Link to comment Share on other sites More sharing options...
mikel Posted November 29, 2020 Share Posted November 29, 2020 Hey @gareth, ... and a loop for the duration: duration, delay, and stagger do NOT refresh. See the Pen OJRPaPG?editors=1010 by mikeK (@mikeK) on CodePen Happy looping ... Mikel 4 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now