102 Posted April 19 Share Posted April 19 I am doing exact same thing with this post but updating position along the path with motionPath is just making position (0,0) for each frame. What is causing this? Codepen: const path2 = [{x:ball.x, y:ball.y}, {x: cp2x, y: 40}, {x: target.x-ball.x,y:target.y-ball.y}] console.log(ball.x, ball.y) gsap.to(ball, { duration: 1, motionPath:{ path: path2, type: 'cubic' }, onUpdate: () => { console.log(ball.x, ball.y) }, onComplete: () => { console.log("complete") if (ballInfo.target < this.pins.children.length) { ballInfo.target++; this.moveBall(ball, index); } else { // End of animation logic } } }); See the Pen dyLQorr?editors=0011 by alparslanahmed (@alparslanahmed) on CodePen Link to comment Share on other sites More sharing options...
GreenSock Posted April 19 Share Posted April 19 That's because your path data isn't valid. You specified type: "cubic" but your path data only has 3 points instead of 4. 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