Jump to content
Search Community

is there a way to get the vars of the current playing tween of a timeline?

chrisi51 test
Moderator Tag

Recommended Posts

there is timeline.recent() which gives you the last added tween but the last added tween is not the actual current tween animated. Is there a way i can grep the information, which parameters are just in this moment animated?

 

Most impressive would be a way to get "The object is just moving from x:20, y:20 to x:100, y:100" like start position and end position of the current running tween.

Problem on that may be, that there can be multiple tweens currently running on the same time, which makes it harder, i guess.

 

Thanks in advance.

Link to comment
Share on other sites

Hey chrisi51. At any given point of a timeline an infinite number of tweens (theoretically) could be playing. This is the first time to my knowledge that someone has requested the functionality that you're wanting. Most likely there's a better way to do about doing this sort of thing.

 

What's your end goal? Perhaps if you made a minimal demo of your situation we could help you come up with a better solution with the existing functionality.

Link to comment
Share on other sites

the end goal is to kill an animation but instead of just letting everything get resetted or disappeared or something like the active motion should animate a little further while the elements get opacity 0 

 

as the movements of the objects are very random i can't predict them and so i would need to read it ... think of a flying missile which get code 0 and so looses its target ... its just passing by and explodes seconds later 😆

 

i tried a lot like killing the first animation as a complete callback of the new animation but that throws a lot of problems. its very abstract and i cant show you the actual problem cause of not allowed to show any content right now. maybe i can provide a minimal demo later. or just take this one: 

its the same project

 

8 minutes ago, ZachSaucier said:

At any given point of a timeline an infinite number of tweens (theoretically) could be playing.

that was, what i thought off ... might be a big troublemaker to provide such a function :)

Link to comment
Share on other sites

7 minutes ago, chrisi51 said:

the end goal is to kill an animation but instead of just letting everything get resetted or disappeared or something like the active motion should animate a little further while the elements get opacity 0 

So why not just create a tween that animates the opacity and then at the end of it kill the old animation?

  • Like 1
Link to comment
Share on other sites

ya i actually tried that but there was lot of problems occuring on that way.

the animation have only to run if it is in viewpoint and so i have to kill and restart it different times. when i was going that way there were problems on the next restart but maybe its just missing start values ... probably i was close to the solution and didn't saw the forest cause of all those trees :P 

 

Thank you for leading the way :) 

Link to comment
Share on other sites

36 minutes ago, chrisi51 said:

ya i actually tried that but there was lot of problems occuring on that way.

the animation have only to run if it is in viewpoint and so i have to kill and restart it different times.

Yeah, it's hard for us to offer advice without a clear demo, but I don't know why you'd have issues with doing what Zach recommended. If that approach isn't working, please shoot us a minimal demo showing it breaking and we'd be happy to take a peek. 

 

Another thing to consider: gsap.exportRoot(), take that timeline and you could literally animate its timeScale down (so all your animations appear to gradually slow down) while animating the opacity of the targets. Just an idea. I'm not totally clear on your objective. 

 

Happy tweening!

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