-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Bug: Animation with multiple segments loops the last segment only #3064
Comments
not sure what is going on without seeing it myself. when i have an issue like this, I start by making a super simplifed asset and trying that to rule out a few things. if you try to play that and it doesnt work there is something wrong with how you are trying to play the segments in a looping order... if it does work, there is something wrong with your asset formatting perhaps. im afriad i cant help without seeming more. |
Here is a super simple fiddle: The animation should be going forward (segments 10-60) and then backwards (segments 60-10) in a loop. |
mmmm, ok. i see! so looking at your code, i can see it is working as expected and playing the segments you request and then falling back to its loop behaviour. what you want to do it to catch the end of your segment playback, then run the same segment function again. this code got my loading animation working as you are hoping for:
|
Yea this is kind of how I am doing it right now. |
understandable, i wouldnt be thinking to differently from yourself.
but yea, after poking around i think i see the sense behind it... your example only created a function with the instruction to play 2 segments, without defining any new loop behavior, so it seems like correct behavior to me as it stands.
Perhaps the play segment method should have a setting for overriding the loop behavior of set to true? But I could see this getting very messy with complex Lottie’s using multiple loop sections.
|
I have an animation that is made in 3 steps.
The intention is to have the Loading segments looping so the playing frames would be like this:
16 -> 40, 40 -> 16, 16 -> 40, 40 -> 16
etc...However, for some reason only the last segment is being looped so the resulting animation looks like this:
16 -> 40, 40 -> 16, 40 -> 16, , 40 -> 16
etc...I have seen some posts where this seems to be a known behaviour, but I wonder if this isn't a bug?
If this is not a bug, what is the intended way to make such a loop?
I am using
Lottie-web: 5.12.2
Lottie-api: 1.0.3
The text was updated successfully, but these errors were encountered: