chevohin Posted October 19, 2020 Share Posted October 19, 2020 Hi guys, i need your help. I have a scene in adobe illustrator which I export to svg and insert in html. Somewhere in the scene I have a group with id #toy and a path with id #path (I made the path visible). After the click on #toy I want it to move along the #path. In my scene now after the click, the #toy just disappears. I think it is because of some relativeness, so may be it adds the path coords to its current coords. What should I change to fix it? I want the moving object and the path to be in the same svg. See the Pen mdEeyXz by chevohin (@chevohin) on CodePen Link to comment Share on other sites More sharing options...
Solution ZachSaucier Posted October 19, 2020 Solution Share Posted October 19, 2020 Hey chevohin. You just need to use the align property. You probably also want to change the alignOrigin to [0.5, 0.5] (the center). Side notes: .restart() is equivalent to .play(0). ease: "Power3.easeOut" is invalid. Just use ease: "power3". Here's how I'd set it up: See the Pen vYKKQwE?editors=0010 by GreenSock (@GreenSock) on CodePen 3 Link to comment Share on other sites More sharing options...
chevohin Posted October 19, 2020 Author Share Posted October 19, 2020 Thank you, bro! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now