Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
djoe_dev

React ScrollTrigger MotionPath question

Recommended Posts

In the attached codesandbox, I am animating a circle along the motionpath to scrub with scrolltrigger. I would love to have the animated circle stay within the center of the viewport from start to finish. As it is now, the circle speeds up and escapes the viewport, then slows down a lot at the end. I thought maybe this was caused by an easing effect so i set easing to none but did not help.  I wonder why this is? 

 

https://codesandbox.io/s/frosty-poitras-t478y?file=/src/App.js

Link to post
Share on other sites

It looks like you just accidentally nested the "ease" inside the motionPath:{} object. 

 

// BAD:
.to(... {
  motionPath: {
    ease: "none",
    ...
  }
});
  
// GOOD: 
.to(... {
  ease: "none",
  motionPath: {
    ...
  }
});

Does that help? 

  • Like 4
Link to post
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.

×