Jump to content
Search Community

Any suggestions for the initial animation frame rate?

Vector test
Moderator Tag

Go to solution Solved by PointC,

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Am I correct in thinking that pausing your animations until user input is bad practice (I'm sure I read it on here somewhere)? something to do with them not being cached before-hand? It does seem to stutter slightly when it runs for the first time.

 

If this is the case, could anybody offer me some advice on how I would run the animation hidden in the background ASAP and before user input?

 

 

Edit: Excuse the poor thread title. Suppose it should have read more along the lines of 'is pausing animations considered bad practice?'

See the Pen ZOOvwq by Luke87 (@Luke87) on CodePen

Link to comment
Share on other sites

  • Solution

Hi Vector :)

 

You can force the tweens to initially render and record everything by jumping to the end of your timeline and then immediately back to the beginning. Once you've created your timeline, you can just do this:

tl.progress(1).progress(0);

That should get everything ready for you and eliminate that first run stutter that you mentioned.

 

Hopefully that helps.

 

Happy tweening.

:)

  • Like 2
Link to comment
Share on other sites

Hi Vector  :)

 

You can force the tweens to initially render and record everything by jumping to the end of your timeline and then immediately back to the beginning. Once you've created your timeline, you can just do this:

tl.progress(1).progress(0);

That should get everything ready for you and eliminate that first run stutter that you mentioned.

 

Hopefully that helps.

 

Happy tweening.

:)

 

Wow. Never expected it to be so simple... Thanks for that!

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