Jump to content
Search Community

repeatDelay on timeline containing infinite tween

robs test
Moderator Tag

Go to solution Solved by PointC,

Recommended Posts

Hi,

 

what I would like to achieve is to have the fly flapping its wings for 2 seconds or so, then stop and start flapping again after 5 seconds,...

I know I could use setTimeout and setInterval, but I guess this should also be possible with GSAP properties only...

I tried several combinations but somehow I don't get anywhere. Any ideas? 😬

See the Pen xxXOMpg by rob83 (@rob83) on CodePen

Link to comment
Share on other sites

Cool fly!

 

in situations like this another option is to create the infinite animation and then control it inside another timeline.

In the demo below I tween the time() value of wings timeline from the main timeline.

 

See the Pen XWZbeYO?editors=1010 by snorkltv (@snorkltv) on CodePen

 

We can have fun with the speed of wings flapping by changing the duration on the time() tweens.

Notice the last tween tweens to a time:4 in 1 second (very fast going up)

.fromTo(wings, {time:0}, {time:4, duration:1}, "<")

 

  • Like 3
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...