Jim Tim Posted January 31, 2022 Share Posted January 31, 2022 I'm migrating from gsap version 2 - version 3, whenever i try to play timeline method i get this RangeError: invalid array length, i suspects this error occurs because of motionPath vars attributes in gsap.to(), i pass array of co-ordinates to path key, when i pass type:'cubic' it works fine but i dont want the type to be 'cubic', i'm looping through some keyFrames so someTIme the co-ordinates can be same, eg:- [ [ {x: 28.4991, y: 0}, {x: 28.4991, y: 0} ], [ {x: 28.4991, y: 0}, {x: 28.4991, y: 0} ], [ {x: 28.4991, y: 0}, {x: 28.4991, y: 0} ], [ {x: 28.4991, y: 0}, {x: 1074.759725, y: 0} ] ] Link to comment Share on other sites More sharing options...
_Greg _ Posted January 31, 2022 Share Posted January 31, 2022 Hi. Can you create a minimal demo 1 Link to comment Share on other sites More sharing options...
Jim Tim Posted January 31, 2022 Author Share Posted January 31, 2022 Sorry team it's hard for me to create a demo in codePen, but in local i get the error since those error will only throw in development environment , let pathValArr = MotionPathPlugin.arrayToRawPath([{x:155.33,y:225.01},{x:155.33,y:225.01},{x:155.33,y:225.01}]); let pathValStr = MotionPathPlugin.rawPathToString(pathValArr) but this is what the scenario is, try passing three similar coordinates to MotionPathPlugin.arrayToRawPath() method , you will get that error. Link to comment Share on other sites More sharing options...
GreenSock Posted February 1, 2022 Share Posted February 1, 2022 That's a very odd scenario - why are you asking it to plot a curve through points that are all exactly identical? That's the main problem here, but I went ahead and updated the beta to work around that. https://assets.codepen.io/16327/MotionPathPlugin.min.js Link to comment Share on other sites More sharing options...
Jim Tim Posted February 1, 2022 Author Share Posted February 1, 2022 // That's a very odd scenario , yeah you're right but for my project for many paths it has been plotted like this. in previous version ,i haven’t got any issues and kindly fix this issues by next release. Thank you for the quick response 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