Share Posted May 11, 2021 Hi, I have two animations start and end, How can I stop or reset end if I click start. Want animations to work better if buttons are pressed quickly. Thanks See the Pen gOmazwa by buster808 (@buster808) on CodePen Link to comment Share on other sites More sharing options...
Share Posted May 11, 2021 Tweens (and timelines) have a bunch of control methods you can use to... well... control them I guess. Some examples would be tween.play() tween.progress() or tween.kill() You can read more about them in the docs In your case you could kill the previous tween, then recreate a tween with the correct stagger direction and play it? See the Pen 2d6ff124460711653b7cbe1e9dd3961d?editors=0011 by cassie-codes (@cassie-codes) on CodePen 2 Link to comment Share on other sites More sharing options...
Solution Solution Share Posted May 11, 2021 Another option is to set overwrite: true on your tween which will cause it to find all other tweens of the same target(s) and immediately kill them. Basically, you were creating conflicting tweens. 1 1 Link to comment Share on other sites More sharing options...
Share Posted May 11, 2021 ah! That's a good one, I always forget that exists. 1 1 Link to comment Share on other sites More sharing options...
Author Share Posted May 12, 2021 overwrite: true perfect thanks 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