Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
SBoudrias

Detect playhead position change

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

Currently I can't find anything in the documentation to register a function to be called each time the playhead change.

 

You can listen to `onUpdate`, but this function doesn't trigger when you `timeline.seek(2)` to a position.

 

Any solution to be notified by every changed to the playhead without adding tons of timeline callbacks?

Link to comment
Share on other sites

Absolutely - by default (and very intentionally), the seek() method suppresses events because that's actually what most people prefer with seek(), but you can set the suppressEvents parameter to false:

tl.seek(10, false);

Or you could use time() instead because the default behavior for that method is not to suppress events:

tl.time(10);
  • Like 1
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.
×