Jump to content
Search Community

Item follow another down MotionPath with Scrolltrigger

glenn_pot test
Moderator Tag

Recommended Posts

I'd like to have a few (4-5) clickable items floating in space, aligned with a shared svg path, positioned at different intervals along the path and they all move simultaneously 'towards the user' on scroll. I'm able to achieve this using with MotionPath/Scrolltrigger and playing with the z-axis but I could use some direction with aligning the second element to be 'further along' the path, but move at the same speed when the user scrolls. The items should maintain the 'distance' illusion between them as you scroll.

See the Pen LYyRoOG by glenn_pot (@glenn_pot) on CodePen

Link to comment
Share on other sites

Hi glenn!

 

We're happy to answer an GSAP-specific questions, but we don't have the resources to provide free general consulting.

 

You can specify start and end positions for your motion path, and you can also create your own path. ease is not motionPath property. That goes on the animation.

ease: 'power4.inOut',
motionPath: {
  path: [
    { x: 100, y: 0, z: -1000 },
    { x: 100, y: 0, z: 0 },
    { x: 500, y: 10, z: 1000 },
  ],
  start: 0.25
}

 

2 hours ago, glenn_pot said:

but move at the same speed when the user scrolls

 

That might a little tricky. You have an object moving along a curve in 3d space. User scrolling is linear. The best you can probably do is use an ease of "none".

 

  • Like 3
Link to comment
Share on other sites

3 minutes ago, glenn_pot said:

The z-axis manipulation proved more manageable in a separate timeline but I'm not sure if that's the most efficient method.

 

It's fine. There really is no other way to do it if you're going to use an svg path as it doesn't work with z values.

 

  • Like 1
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...