trsh Posted April 20, 2020 Share Posted April 20, 2020 I want to move the blue rectangle to exact red rectangle position by also animating rotation back to 0. But because blue has already rotation, the calculations are some have not right and the blue rectangle is not covering red one. Can someone help please? See the Pen JjYRObr by TrshMan (@TrshMan) on CodePen Link to comment Share on other sites More sharing options...
PointC Posted April 20, 2020 Share Posted April 20, 2020 Sounds like you may benefit from the getRelativePosition() method. https://greensock.com/docs/v3/Plugins/MotionPathPlugin/static.getRelativePosition() More info in this blog post. 2 Link to comment Share on other sites More sharing options...
ZachSaucier Posted April 20, 2020 Share Posted April 20, 2020 If you don't need it to be so dynamic, you can simply set it up more nicely and then zero out the values: See the Pen QWjKOPE?editors=0010 by GreenSock (@GreenSock) on CodePen But if you need it to be more dynamic, Craig's way of using the .getRelativePosition() is the way to go. 2 Link to comment Share on other sites More sharing options...
PointC Posted April 20, 2020 Share Posted April 20, 2020 Good point Zach. I'm a huge fan of placing anything I possibly can at 0,0. It just makes things so much easier. 👍 1 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