Jump to content
GreenSock

Gumbo

Rollercoaster movement along a path

Recommended Posts

Hi.

 

I want the car to follow the track but also the whole of the rollercoaster to move to the left as the car is going along. And also for the car to slow climbing an incline and speed up on the descents. Very hard I know. Can anybody help?

 

Thanks

See the Pen JeMGzL by Gumbo (@Gumbo) on CodePen

Link to comment
Share on other sites

You can study @OSUblake's demos from following thread on how to speed up and slow down based on path.

 

 

You can set viewport based on current x translate of car to create camera like effect of following. You can get x position of car using car._gsTransform.x. But make sure the initial position of car is at 0, 0 in your SVG so you won't need to do additional calculations to get exact position of car.

 

There is another advance demo by Blake, I don't think you need that but here is the link,

 

 

  • Like 4
Link to comment
Share on other sites

Yeah, what Sahil already posted are the best examples of showing the complexity of what you want to achieve. It's no small task.

 

I also thought of this example from Chris Gannon which is a bit simpler all around but necessarily easy. Just for inspiration

 

See the Pen JGXVaR by chrisgannon (@chrisgannon) on CodePen

 

  • Like 3
Link to comment
Share on other sites

Thanks everyone for your responses. I'll have a look into them all.

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.
×