Jump to content
Search Community

Add one animation to another

xforo test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hi! I have an animation of the road. Cars move along it along the x coordinate. At some point in time (for example, when pressed), they should continue to move as before, but at the same time begin to descend down the Y axis. When I try to do this, the animation does not occur or the movement along the x axis stops and only the movement along the y axis remains.

 

I doesnt have codepen, but there is stackblitz with example. 

 

Demo

 

Link to comment
Share on other sites

Thanks for the demo, but unless your issue is related to React it's really best not to provide something that complex with multiple files, dependencies, code for components and all that. A simple demo will be just fine and helps us better focus on the issue without getting hung up on all the unnecessary overhead. 

 

I tried looking at your demo but it wasn't immediately clear how your verticalHandler function was supposed to be invoked. I didn't see a button for that in the UI or any code that called it. 

 

That aside, the following demo should meet your requirements as you described:

 

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

 

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