New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sync two animations using the same AnimationController, but delay the second one by half of the controller duration #96
Comments
If you want to loop this, then:
The idea is to specify to half animation and it will look as if an arrow takes the full width, but internally those are 2 iterations. |
@felixblaschke yes exactly, I want to loop it.
Could you give a small example using my code from above? |
@felixblaschke thank you, this helped. |
Hi,
I have the following use case:
A line with two moving arrows. The first arrow starts at
t=0.0
and animates to the end of the line (t=1.0
).The second arrow starts when the first arrow is at
t=0.5
and animates also from 0.0 to 1.0 until reaching the line end.Currently, I implemented this using 2
AnimationController
s with the following two animations:Both animations have essentially the same structure. They only differ in the
AnimationController
that animates them, and in the respective animation property to be animated (AnimatedArrows.arrow1Progress
vsAnimatedArrows.arrow2Progress
).The animation controller
arrow1Controller
is started, and when it reaches a value>= 0.5
,arrow2Controller
is started as well. Like this, the arrows are animating more or less correctly. But they are not 100% synchronized correctly, asarrow1Controller
never hits exactly0.5
as a value, but always values like0.56
,0.58
or similar.I also tried to put everything in to 1 animation, using 2 scenes and start the second scene later.
Like this, the problem is that once arrow1 has reached the end of the line, it waits for arrow2 to reach the end of line as well, instead of starting to animate again already.
The goal is to achieve a fluid animation that constantly animates, using 1 single
AnimationController
, which must be actually possible, but I don't know how.Any hints on this?
The text was updated successfully, but these errors were encountered: