Brendan8c Posted February 7, 2022 Share Posted February 7, 2022 How to convert the given TweenMax code to gsap 3? I tried changing it but it didn't work for me. I will be glad if you help me with this. See the Pen bGqWYje by brendan8c (@brendan8c) on CodePen Link to comment Share on other sites More sharing options...
Solution OSUblake Posted February 7, 2022 Solution Share Posted February 7, 2022 Welcome to the forums @Brendan8c Normally I would advise against animating the transform attribute like that, and just use GSAP properties like x, y, and rotation, but I didn't want to mess the animation as it already works. See the Pen eYegRwL by GreenSock (@GreenSock) on CodePen Also, here's the Migration Guide for v3. 2 1 Link to comment Share on other sites More sharing options...
Brendan8c Posted February 7, 2022 Author Share Posted February 7, 2022 49 minutes ago, OSUblake said: Welcome to the forums @Brendan8c Normally I would advise against animating the transform attribute like that, and just use GSAP properties like x, y, and rotation, but I didn't want to mess the animation as it already works. Also, here's the Migration Guide for v3. Yes, thank you, you helped me. I've tried setting properties like x, y, and rotation, but the animation behaves differently. gsap.to('.blob', { duration: 2, x: "random(50, 0.1)", y: "random(20, 0.8)", rotation: "random(-0.1, -0.8)", ease: Linear.easeNone, repeat: -1, repeatRefresh: true }) Link to comment Share on other sites More sharing options...
OSUblake Posted February 7, 2022 Share Posted February 7, 2022 Yeah, that's why I said I would normally recommend using x, y, and rotation, but it won't work the same with the original animation due to the way transforms are stacked with the 2 rotations in there... rotate() translate() rotate(). 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