Jump to content
Search Community

2 different TimeLineMax with fromTo on same object

Thiago Kadooka test
Moderator Tag

Go to solution Solved by Carl,

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 people!

 

First i want to say that i searched for this everywhere and i didn't find any answer.

If it is a common problem or anything, IM DEEPLY SORRY! (sorry for my english too)

 

well, so...

 

I made this in codepen, the problem is:

 

i have 2 timelinemax here, when i press next or previous, it will play (as restart) those 2 timelines. it is just an animation to go from left to right, rotation:0 frist time, rotation:180 in the second.

 

i play the first, ok.

i play the second, ok.

 

and them, i go back to the first, thats the problem... it seems to ignore the "from" statements of that "fromTo".

 

and the most wierd, if on the first timeline, i let a "rotation:90" in the "to" part, it seems to work just fine!

 

I dont know, it is kinda a complicated situation i guess, and maybe i didnt made it clear what is going on... just ask any question i try to explain it more.

 

Its supose to really work like this, or this is a bug?

See the Pen PqWPoM by tochjunin (@tochjunin) on CodePen

Link to comment
Share on other sites

  • Solution

Hi and welcome to the GreenSock forums,

 

I had a little trouble understanding what you wanted to do, but please let me know if this is the behavior you want:

 

http://codepen.io/GreenSock/pen/vOgKYb

 

The main problem is that you were creating multiple tweens in multiple timelines at the same time that were fighting to set and record the starting (from) values on the same properties of the same object. Please notice that I put immediateRender:false on each tween. What this means is that values will not be recorded in the timeline or set on the object until the timeline first plays.

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...

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