PointC Posted March 29, 2020 Share Posted March 29, 2020 I'm trying the getPositionOnPath() method for the first time and getting an error. Is this a bug or am I not understanding this method? 🤔 See the Pen GRJzqoN by PointC (@PointC) on CodePen 1 Link to comment Share on other sites More sharing options...
Shrug ¯\_(ツ)_/¯ Posted March 29, 2020 Share Posted March 29, 2020 I guess I'm a bit puzzeled also even when trying the exact snippet from the docs. You also seem to be the first person to post anything on Codepen at least publicly or here on the forums.  So congrats @PointC ...   :--) 1 Link to comment Share on other sites More sharing options...
GreenSock Posted March 30, 2020 Share Posted March 30, 2020 Ha, sorry about that - I hadn't realized that Zach documented that method  and I'm sure I neglected to tell him an important detail - in order for it to do the calculations, it must first have certain measurements cached using a special method. // cache the measurements first (only necessary once, unless the path data changes) MotionPathPlugin.cacheRawPathMeasurements(rawPath); See the Pen bf0acd15a298f9f2dc230b7e51a90d76?editors=0010 by GreenSock (@GreenSock) on CodePen  I wonder if it's better to just remove that method from the docs. Or do you think it'd be helpful for folks? I just don't want to confuse people with the caching caveat that'd be necessary too, and maybe it's a method that nobody would really care about anyway. (?) 4 Link to comment Share on other sites More sharing options...
PointC Posted March 30, 2020 Author Share Posted March 30, 2020 5 minutes ago, GreenSock said: Or do you think it'd be helpful for folks? I don't know if it'll be helpful. I couldn't get it to work. 🤣  I was making some new demos today and saw that method which may work as one option to what I was trying to accomplish. I have other possibilities to achieve the same result, but wanted to familiarize myself with all available methods. I think mentioning the caching caveat in the docs will be fine. Now that I know about it, I can try the rest of my experiments and see how it goes.  Thanks for the update.  1 Link to comment Share on other sites More sharing options...
Shrug ¯\_(ツ)_/¯ Posted March 30, 2020 Share Posted March 30, 2020 It's impressive that both youself and Zach are so proactive to keep things moving forward, much better to catch up than lag behind.  Thanks for all the great work! 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