Jump to content
GreenSock

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

Trying to tween the time, over the timlinemax duration into a complete loop

Go to solution Solved by OSUblake,

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

I have a complex Timeline which is made into a infinite repeating loop.

 

The user can press a forward/backwards button that tweens the timeline time 1 second either way.

 

Tweening the time backwards 0 to -1 loops correctly,   but i can't seem to get the time to tween past the total duration to the beginning.

 

Simplified Timeline going around a square.

0  (start  @ top left)

1   Right

2   Down

3   Left 

4   Up

 

With the current time point of 2 you can tween backwards 3 seconds,  and it will play 2, 1, 0, 4 

But going forwards  3 seconds from the same point,  it always stops a 4.

 

 

 

See the Pen YXmqzz?editors=101 by akentigernfox (@akentigernfox) on CodePen

 

Any help would be greatly appreciated in what i've missed

See the Pen YXmqzz by akentigernfox (@akentigernfox) on CodePen

  • Like 1
Link to comment
Share on other sites

  • Solution

I added duration/totalDuration and time/totalTime just to see the numbers. You were just tweening time, which stops at 4 secs, so that why it couldn't go past one cycle. Changing it to totalTime allows it to go past the 4 second mark.

 

 

See the Pen bdXpMa?editors=101 by osublake (@osublake) on CodePen

  • Like 6
Link to comment
Share on other sites

Thank you, i'm now on the right track again.

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