Jump to content
Search Community

timeline.seek fails to jump to a label

antonis test
Moderator Tag

Go to solution Solved by ZachSaucier,

Recommended Posts

Hello all,

 

My code should execute a loop moving the box left and right and after some time it should move it all the way right and finish the timeline.

 

I wrote the following code and some times it fails to seek the label "end" and stucks in a loop...

console keep printing the "end" infinty and the box is not on the right as it should be, as you can see from my screenshot below.

If you hit RUN a couple of times you may see it.

I am using Chrome Version 86.0.4240.193 (Official Build) (64-bit) on linux

 

image.thumb.png.876376bcbea304e8079bbc3e0fe15dac.png

See the Pen oNLQVZQ by codedgr (@codedgr) on CodePen

Link to comment
Share on other sites

  • Solution

Hey antonis and welcome to the GreenSock forums.

 

I would set up the logic a little differently. Instead of trying to seek to the label that is at the same time as the .add(), why not just only seek if times is 'first'? Like this:

See the Pen MWezMGE?editors=0010 by GreenSock (@GreenSock) on CodePen

 

Also we recommend the modern syntax.

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