Jump to content
Search Community

Animate to a specific position on a circle path

Saif test
Moderator Tag

Go to solution Solved by OSUblake,

Recommended Posts

Hey everyone,

 

I'm new to Gsap so forgive me if I mistake any technical terms.

 

My animation is  two-fold, first to animate a dot from wherever it may be in the document to a specific point on the circle path (for instance the halfway point in the path). Second, upon reaching the point on the circle path, an animation of following the circle path infintely.

 

What I attempted to do was get the rawPath of the path and then getPositionOnPath to get the the co-ordinates of the halfway point of the path, however the co-ordinates appeared to be global.

 

So I then used getRelativePosition and provided the co-ordinates from getPositionOnPath which I believe made the co-ordinates local to the Path.

 

However as can be seen from the CodePen the dot does not go to the halfway point of the path (bottom of the circle).

 

Can someone kindly tell me what I did wrong? or if there is a better way to go about this?

 

Thank you in advance.

 

See the Pen jOaKzEg by Safety_guy (@Safety_guy) on CodePen

Link to comment
Share on other sites

  • Saif changed the title to Animate to a specific position on a circle path

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