Share Posted March 30, 2022 Hello, in my codepen i'm trying to tween between two arrays: const frameArray = new SVG.PointArray([ [0, 0], [width, 0], [width, height], [0, height], [0, 0] ]); and const randomFrameArray = new SVG.PointArray([ [0, width / 2], [width, 0], [width, height], [0, height], [0, 0] ]); using the following timeline tl.to(frameArray, 2, randomFrameArray ); the SVG.PointArray class produces an array of arrays and Im not sure if that is the issue? Thanks in advance See the Pen GRyvrEV by limitedunlimited (@limitedunlimited) on CodePen Link to comment Share on other sites More sharing options...
Solution Solution Share Posted March 30, 2022 Hi James, You can't animate a nested array like. There is the EndArrayPlugin that's built into GSAP, but you would need to create your animations in a loop. let arrayOfArrays = [[1],[2],[3]]; let endArrayOfArrays = [[4],[5],[6]]; arrayOfArrays.forEach((arr, i) => { gsap.to(arr, { endArray: endArrayOfArrays[i], onComplete: () => console.log(arrayOfArrays) // [[4],[5],[6]] }); }); Also, it's pretty easy to animate points without a library. 1 Link to comment Share on other sites More sharing options...
Author Share Posted March 31, 2022 Thank you for both solutions @OSUblake. I think I will try animating the points. 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