Jump to content
Search Community

MotionPathPlugin alignment issue

ryanpwaldon test
Moderator Tag

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.

Ryan

 

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

  • Thanks 1
Link to comment
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
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.
×
×
  • Create New...