-
Notifications
You must be signed in to change notification settings - Fork 182
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] Rive StateMatchine with multiple layers does not work properly #342
Comments
@luigi-rosso any chance you can look into this, please? Thanks 🙏 |
Hi @Sh1d0w, I don't think I'm reproducing the problem correctly. This seems to behave properly for how the layers are setup: Screen.Recording.2023-08-31.at.8.46.42.PM.movDoes that look as expected or is something missing that I'm not catching? Code I used:
|
@luigi-rosso Thanks for looking into this. Yes that's the correct behaviour. But in my app it does not do this with the latest version of the plugin. It skips the whole layer of background change, and only triggers the stars animation. Screen.Recording.2023-09-01.at.8.26.15.movWeird. Let me setup a bare flutter repo and I will try to reproduce it there, as our app is closed source. Thanks again for your time, will get back to you. 🙏 |
@luigi-rosso OK I've found out what the issue is. From the difference in your code and mine it seems that it works when it is triggered from onTap event, all good. But if I do it like my original post, e.g. in the rive's onInit callback, it does not work. Is that expected, a limitation, or a bug? As I would expect to setup and trigger the animation right inside the init, not via gesture? What would be the correct way to do that in such case? The use case is as you can see I have a very complex animation, so I have some Flutter logic which trigger should be fired, so auto play does not suit my need. I need to setup the input first and then based on some conditions to trigger the correct animation right after the initialisation without user interference. |
I've workaround it by creating an async function _animate that I call from
It works, but not sure if this is intended or not. Feel free to close if you don't think this is bug. Thanks for your help mate! |
Description
I have a Rive StateMachine with 3 layers in it. When an input is fired I have different conditions that trigger animations on all 3 of the layers.
It works perfectly with Rive for React, but when I import and use the Rive animation in flutter it only triggers the animation from the last layer and then exits, without animating the rest at the same time. Subsequent triggers also does not seem to trigger any animations.
Steps To Reproduce
Use the animation from the attached archive.
Source
.riv
/.rev
filepoc.zip
Expected behavior
When I hit the trigger all layers of animations are executed simultaneously.
Device & Versions (please complete the following information)
The text was updated successfully, but these errors were encountered: