rive-app / rive-flutter

Flutter runtime for Rive
https://rive.app
MIT License
1.16k stars 180 forks source link

Speed on Editor didn't take effect when i run it inside flutter #306

Closed faizabdillah closed 1 year ago

faizabdillah commented 1 year ago

Screenshot_1144 i set the speed by 2x,when i play it inside editor, its works like how it used to, the speed multiple by 2 times but when i run it with flutter, the speed is come back to normal

even when i preview the file, and play it, the speed is not speed up image (i use this extension to preview the file, https://marketplace.visualstudio.com/items?itemName=ronba.vscode-rive-viewer)

https://drive.google.com/file/d/1vygvOHLtzkI6P2a6LkXbo-5L6DN_ZGA6/view?usp=share_link this is the file

HayesGordon commented 1 year ago

Hi @faizabdillah, the VSCode extension is not maintained by us and has not been updated in a long time. This means that it won't be able to apply Speed on States as it's a new feature.

With regards to running on Flutter, I believe it's because you may not be specifying the State machine name. On the Flutter runtime if you do not provide a state machine it will play the default animation. And Speed on States only work through the State Machine.

Here is an example:

return const Scaffold(
  body: RiveAnimation.asset(
    'assets/rotate-speed.riv', // asset name
    stateMachines: ['State Machine 1'], // name of your state machine
    controllers: [], // or you can create a State Machine controller yourself
  ),
);

See our docs for Flutter on State Machines

Let me know if this works for you.

faizabdillah commented 1 year ago

my bad, i'm using version 0.10.2 before, after i update it to 0.10.3 its works perfectly, anyway thanks for your response image