Jump to content
Search Community

Call back function for end of motionpath

fd_alistair
Moderator Tag

Go to solution Solved by iDad5,

Recommended Posts

fd_alistair
Posted

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.

Posted

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?

fd_alistair
Posted
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.

  • Solution
Posted

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

  • Like 1
fd_alistair
Posted
3 minutes ago, iDad5 said:

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

 

Legend! - thank you

  • Thanks 1

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