Jump to content
Search Community

Tween A Paused Timeline To Loop Past Its Duration

benjaminben test
Moderator Tag

Recommended Posts

Is there a way to tween a timeline beyond its duration in an infinite loop? Take the following example:

 

const tl = gsap.timeline({ paused: true })

tl.set(thing, { x: 0 })
tl.to(thing, { x: 100 })

gsap.to(tl, { progress: 0.5 }) // X will arrive at 50
gsap.to(tl, { progress: 1 }) // X will arrive at 100
gsap.to(tl, { progress: 1.5 }) // But can we make X arrive at 50 again by looping around??

See the Pen WNJmjxj by benjaminben (@benjaminben) on CodePen

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...