Jump to content

Search In
  • More options...
Find results that contain...
Find results in...

MotionPathPlugin alignment issue

Recommended Posts

Hi everyone,

I'm having an issue aligning an element (a car) to a path (a road). I've provided a simplified example (the SVG is large, although, I thought it was best to include the entire thing for context).

I'm using the align property with the target path as the value, although it doesn't seem to be working – the car appears a few hundred px away from the target path.

(I'm probably missing something simple)

Would greatly appreciate any help.



See the Pen LYEwOvW by ryanpwaldon (@ryanpwaldon) on CodePen

  • Thanks 1

Share this post

Link to post
Share on other sites

Ah yes, that's because that element is a <g> which acts a bit differently. I'll work on a fix for the next release, but in the meantime you can just use the element's bounding box as offsets:

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


Just keep in mind that in the next release with the fix in place, you'll want to remove those offsets. 

  • Like 4
  • Thanks 1

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.