Jump to content
Search Community

Does .time () take into account the .timeScale?

mikel test
Moderator Tag

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



Last days there was a post to the web http://antonin.space/alcara/ - not there anymore.


This page contains many little neatly arranged animations - the wonderful world of pixi.


Here's just a try ...


See the Pen JQdmKJ#0 by mikeK (@mikeK) on CodePen


My question: Why does .time () not consider the current .timeScale (line 112 ff) ?


Best regards

See the Pen JQdmKJ by mikeK (@mikeK) on CodePen

Link to comment
Share on other sites

Hey @mikel :)


I'm not sure I understand the question, but changing the timeScale() of an animation won't change the duration.


A 1 second animation with timeScale(4) will still have a duration of 1 second so the playhead time() will still travel from 0 to 1 and not 0 to 0.25. 


Does that help at all?

  • Like 3
Link to comment
Share on other sites

I'm a little fuzzy on what you're asking too, but @PointC is correct - timeScale() merely affects the way that its parent timeline plays it. If you want to calculate its duration in a way that factors in timeScale, you'd simply do: 


var scaledDuration = animation.duration() / animation.timeScale();


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