Jump to content
Search Community

MotionPathPlugin Question: from() along path to original position?

cooganb test
Moderator Tag

Recommended Posts

Hi there!

 

I've been wanting to dig into MotionPathPlugin for a while but just getting a chance to now. I have a question on positioning:

 

As you can hopefully see in the example, I have a series of circles positioned along a path. I'd love to animate each circle start at the beginning of the path to go to their original position on the path while following the path. Is this possible? 

 

Thanks for the help!

See the Pen dyOMgwV by cooganb (@cooganb) on CodePen

Link to comment
Share on other sites

Thanks for this, @mikel ! I wasn't sure about `end`, so thank you for sharing that. Is that the best way to dictate starting or finishing position?

 

And when using `from()`, for example, everything appears on the path coordinates. The object doesn't retain any of its original x,y values?

Link to comment
Share on other sites

Hey cooganb. The issue here is that MotionPathPlugin has no way of knowing that the objects are along the path to begin with. How could it determine what progress value of the animation along the path it should be? It really can't. 

 

I recommend creating the initial position of the dots along the path by attaching each to the actual path position using MotionPathPlugin. Then you can do figure out what the end value for that dot should be. 

See the Pen XWNKKrd?editors=0010 by GreenSock (@GreenSock) on CodePen

  • Like 3
Link to comment
Share on other sites

  • 3 weeks later...

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