Jump to content
Search Community

Object is not following svg motion path

Abozanona test
Moderator Tag

Recommended Posts

I'm trying to move an object `#from` to another object `#to` along a path defined in an svg element.

 

If I try to move a circle along the path using `align` & `alignOrigin`, the circle indeed moves along the path, as shows in the codepen code sample.

 

But what I need is to move an object from it's current position to another's object position, and I want the shape of the movement to be like how it is in the path, even if SVG was not visible. The current behaviour is that the `#from` object start position is changed, and the end position is not the same as `#to` object.

 

What I'm trying to do is somehow move an object to a point using a path. If the distance between the two objects is for example longer than the defined path, I would expect the path to expand to match the distance between the two points. I also want to expect that object a will move to the same exact position as object b using the path even if the path's position was not between object a & b.

See the Pen XWQdjwM by abozanona (@abozanona) on CodePen

Link to comment
Share on other sites

Sorry, but that's not what MotionPathPlugin does - it can't just automatically stretch and rotate the path such that it perfectly touches two elements. It follows the path you provide. So if you want that path to be different, you'll need to adjust your path. 

 

If you want help writing code that could do that stretching/rotating, we do offer paid consulting services. It's well beyond the free help we can provide in these forums. 

 

Good luck with the project!

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