tailbreezy Posted December 15, 2021 Share Posted December 15, 2021 Hello, I am wondering is there a way to tell the current value of a tween prop ( say "x") before any tweening. For example: gsap.to(".class", { x: "+=100" } // how to "properly" tell what x is before we add 100 I reckon it is target._gsap[prop], but is it expected to be used like that. x: (_,t) => { var val = t._gsap["x"]; val = val ? parseFloat(val) : 0; return val + 100 Is this what the engine does behind the scenes? Is this equivalent to "+="? Cheers Link to comment Share on other sites More sharing options...
Solution PointC Posted December 15, 2021 Solution Share Posted December 15, 2021 I think you're looking for the .getProperty() method. https://greensock.com/docs/v3/GSAP/gsap.getProperty() Happy tweening. 4 Link to comment Share on other sites More sharing options...
tailbreezy Posted December 15, 2021 Author Share Posted December 15, 2021 Thank you, @PointC. I think this is the one 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