Jump to content
Search Community

MotionPathPlugin is not working with Pixi

102 test
Moderator Tag

Recommended Posts

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
                        }
                    }
                });

image.png.e7c15683a8feb1fab6e881796e892022.png

See the Pen dyLQorr?editors=0011 by alparslanahmed (@alparslanahmed) on CodePen

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...