Jump to content
GreenSock

fd_alistair

Call back function for end of motionpath

Go to solution Solved by iDad5,

Recommended Posts

Hi there, I've checked the documentation for MotionPath and can't see the ability to add a callback function for when the animation has completed?...ideally I'd like this to be called at the end of each loop.

 

Any help would be appreciated.

 

Regards

Al

See the Pen wvmymvz by fuzzyduck (@fuzzyduck) on CodePen

Link to comment
Share on other sites

Just a onComplete on the tween (gsap.to()) should do the trick. If you think about it, what ist completed isn't the motion-patt (the road you walk down) but your movement (the walk you took).

Does that clarify things, or do you need more help?

Link to comment
Share on other sites

4 minutes ago, iDad5 said:

Just a onComplete on the tween (gsap.to()) should do the trick. If you think about it, what ist completed isn't the motion-patt (the road you walk down) but your movement (the walk you took).

Does that clarify things, or do you need more help?

 

Ok thanks - I had tried that previously...am I doing something wrong? : 

See the Pen YzaeaBG by fuzzyduck (@fuzzyduck) on CodePen

Link to comment
Share on other sites

  • Solution

My bad, your walk never ends ;-) So onRepeat is what you are looking for. 

  • Like 1
Link to comment
Share on other sites

3 minutes ago, iDad5 said:

My bad, your walk never ends ;-) So onRepeat is what you are looking for. 

 

Legend! - thank you

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