Jump to content
GreenSock

Xenex122

How to reset the animation after the animation got click.

Recommended Posts

I was trying to restart my animation after it got click and do the same animation again...but it was restarting the animation..It was reversing the animation how could I fix this? I tried to create a tl.restart() to make the animation go back to the same position but it bouncing back.

Anyway this is my codepen. 
 

See the Pen QWQobrY by myth-vince (@myth-vince) on CodePen

Link to comment
Share on other sites

EDIT NO DON"T DELETE THIS HAHHAHA I WAS WRONG

Link to comment
Share on other sites

Do you have a question Xenex?

Link to comment
Share on other sites

You should create your timeline outside of your click handler. All you're doing right now is adding tweens on each click and creating a longer and longer timeline.

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