Jump to content
Search Community

GSAP animation

Yarchick1034 test
Moderator Tag

Recommended Posts

Hello everyone, I have two blocks that tend to one point, because since the initial positions are different, then they have different speeds along the path.

Is there a setting that allows you to set the same animation speed, but different path lengths?

 

gsap.to(graphics, 2, { ease: "none", y: 1000 });

 

Link to comment
Share on other sites

Hey Yarchick and welcome to the GreenSock forums!

 

The best way is probably to create two tweens, using the distance calculation as a part of the duration calculation. Modifying a demo I made for another person, you could do it this way:

See the Pen vYOXVbO?editors=0010 by GreenSock (@GreenSock) on CodePen

 

Or even better, use the .getRelativePosition() function of MotionPathPlugin that will be in the next release of GSAP to do most of the calculations for you!

See the Pen ExjgdMr?editors=0010 by GreenSock (@GreenSock) on CodePen

  • Like 3
  • Thanks 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...