Share Posted June 13, 2017 (edited) I am new to GSAP and am putting together a 2.5D rotating coin using GSAP scaleX and x. The coin is meant to a) "rotate" in the tails side, then rotate out the tails side, then c) rotate in the heads side, then d) rotate out the heads side, and then the loop of the sequence begins the rotate in of the tails side again. I have gotten the animation as far as c), but when I try to use scaleX to start d), something happens to the timeline and the "heads" side of the coin appears from the very start of the animation. I have included a codepen here: https://codepen.io/bamartelly/pen/RgayML If you un-comment lines 103 to 108 (pasted in below too) you can see the animation breaking when I try to start implementing step d). .fromTo(coin.heads, flipTime,{ scaleX:1, x:0 } , { scaleX:0, x:8 }, "headEnd") Here's the codepen with lines 103 to 108 uncommented, you can see how it all turns to custard: See the Pen GEqreZ by bamartelly (@bamartelly) on CodePen Any help greatly appreciated. Thanks! See the Pen RgayML by bamartelly (@bamartelly) on CodePen Edited June 13, 2017 by bamartelly clearer explanation of the problem Link to comment Share on other sites More sharing options...
Share Posted June 13, 2017 Hello @bamartelly and sorry your having an issue. And Welcome to the GreenSock Forum! This is not a GSAP bug. Since your using a fromTo() tween you have to keep in mind that all from() tweens render immediately. So to prevent this you must add immediateRender:false to your from tween. fromTo() : https://greensock.com/docs/#/HTML5/GSAP/TimelineMax/fromTo/ NOTE: by default, immediateRender is true in fromTo() tweens, meaning that they immediately render their starting state regardless of any delay that is specified. This is done for convenience because it is often the preferred behavior when setting things up on the screen to animate into place, but you can override this behavior by passingimmediateRender:false in the fromVars or toVars parameter so that it will wait to render the starting values until the tween actually begins. You can see by adding that the animation starts with tales side. See the Pen vZKrmR by jonathan (@jonathan) on CodePen Does this help? 4 Link to comment Share on other sites More sharing options...
Author Share Posted June 13, 2017 yes thanks this answers my question thanks Jonathan! 2 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