Jump to content
Search Community

Timelinelite - simultaneous animations

Philll 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

Hello

 

I have the following code:

tl.to($wheel, 5, {rotation: 720});

That works fine. But I need the car to move at the same time... I assumed the code would have been:

tl.to($wheel, 5, {rotation: 720}, $carbodycontain, 5, {scale: 0.5});

But that doesn't work. In timelinelite is there a way to animate multiple objects at once without creating a new timeline?

 

Thanks

Link to comment
Share on other sites

tl.to($wheel, 5, {rotation: 720});
tl.to($carbodycontain, 5, {scale: 0.5},'-=5');

By adding '-=5' after the vars object you're overlapping the next tween with the previous one by 5 secondes (meaning they will both start at the same time).

 

Also i'd suggest you to read http://www.greensock.com/get-started-js/ you can find some great examples for using timelinelite/max

  • Like 3
Link to comment
Share on other sites

Peleg, is exactly right and in addition you could put an absolute time as the position parameter.

 

 

Assuming the wheel tween is the first tween in the timeline and has a start time of 0, you can 

tell the second tween to start at a time of 0 as well:

tl.to($wheel, 5, {rotation: 720});
tl.to($carbodycontain, 5, {scale: 0.5}, 0);
OR you can place both tweens at the same label
 
tl.to($wheel, 5, {rotation: 720}, "carGo");
tl.to($carbodycontain, 5, {scale: 0.5}, "carGo");

Couldn't I already do that without using Timelinelite? 

 

Well, sure you could have just used 2 tweens outside of a timeline, but your question was very specific to TimelineLite.

 
Does using that still work in reverse?
 
Sure, reversing the timeline will reverse both tweens
 
--
 
I'd recommend watching the entire video below, as it touches on a few of the ways to position tweens in a timeline
 
  • Like 5
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...