Peach2tm Posted July 8, 2021 Share Posted July 8, 2021 I dont quite understand the logic of gsap here, so I would be happy if anyone could explain why an animation added before a label is not playing, if the timeline starts paused at the label. See the Pen JjNXQwe by anders-wibroe (@anders-wibroe) on CodePen Link to comment Share on other sites More sharing options...
GreenSock Posted July 8, 2021 Share Posted July 8, 2021 That's because by default, .seek() has suppressEvents set to true. Think of it like a record player where you'd pick up the needle, move it, and drop it in the new place rather than dragging it across the record. The needle is the playhead. No callbacks between the old position and the new position are triggered (they're suppressed). If you want to trigger them, just set the suppressEvents parameter to false: tl.seek("runwayStarted", false); Happy tweening! 2 Link to comment Share on other sites More sharing options...
Peach2tm Posted July 8, 2021 Author Share Posted July 8, 2021 Thanks dude! Are the the tl.to('#plane',{x:100}) tl.to('#plane',{y:100}) before the label not considered events/callbacks - or why are they still observed? Link to comment Share on other sites More sharing options...
Cassie Posted July 8, 2021 Share Posted July 8, 2021 3 hours ago, GreenSock said: That's because by default, .seek() has suppressEvents set to true. Think of it like a record player where you'd pick up the needle, move it, and drop it in the new place rather than dragging it across the record. The needle is the playhead. No callbacks between the old position and the new position are triggered (they're suppressed). If you want to trigger them, just set the suppressEvents parameter to false: tl.seek("runwayStarted", false); Happy tweening! TIL 🧠 In terms of the tweens being 'observed' - they kind of are and they kind of aren't. The timeline skips to a certain point and the state of the elements at that particular point is observed - but they don't 'play' I've updated this pen to rotate and scale the plane so that it's easier to see the difference between the first two tweens and the last two. At the label the plane's been scaled up and rotated, and it's ready to continue on with the rest of the animation - but as Jack said - it's like lifting a record needle up and popping it down at that point in the animation. We don't see the plane move to that position. See the Pen abWZNqm by svganimationworkshop (@svganimationworkshop) on CodePen 2 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now