-
Notifications
You must be signed in to change notification settings - Fork 476
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
Animation not changing when no keyframes #31
Comments
Hi @sergiandreplace! Could you share the link to your Flare file? I think this might be a case of poor documentation on our side. When Flare (in the editor) swaps from one animation to another, it resets all your properties for every object back to their setup state. At runtime (in Flutter) this does not happen as we allow blending animations on top of each other, so the results from one animation will persist unless they are overwritten by another. That means that if you plan to switch between animations, and you expect certain properties to return to their setup value, you'll need to manually key them in your second animation. This will be clearer when we add support for a state machine that'll let you switch animations directly in Flare so you can preview the fully blended animations and all their various transitions before exporting to Flutter. |
In this case, I suspect you want to key the properties you move in MovingRight in your Idle animation at their setup state. You can do this by adding one keyframe at the start of Idle for each property you change in MovingRight. In the future we could also explore adding an option to the widget (and the FlareControls controller) to automatically reset the state for you. |
Makes complete sense, that also explains my question on how to "morph" from one animation to another (if I understood correctly, it's just magic 😆 ). |
Here the file: https://www.2dimensions.com/a/sergiandreplace/files/flare/golf-hole/preview But already added keys to the idle animation (making a quick and dirty flag-wave animation) |
Regarding the morphing, yes, Flare handles that for you! By default the FlareWidget will mix the incoming animation for 0.1 seconds on top of the previous animation (the previous animation will keep playing too so the mix/morph happens as both animations are changing, which works very well for very dynamic animations when transitioning from say a run to a walk cycle). Furthermore, it works with as many animations mixed on top of each other as you want! |
Great! Nice work guys! |
Hi
I have a Flare file with two animations: idle and moving. Idle is just a static figure, with no movement.
If in Flutter I change the animation assigned to the actor from moving to idle, nothing happens and it still shows the moving one.
The only way I've found of fixing this was adding "fake" keyframes to the idle animation.
Is this the expected behaviour?
The sample code (dirty one, I was playing around 😄)
The text was updated successfully, but these errors were encountered: