Gamote / lottie-react

A lightweight React library for rendering complex After Effects animations in real time using Lottie.
https://lottiereact.com
Other
794 stars 58 forks source link

Is the "chain" mode available for the interactivity hook? #69

Open g1sbi opened 2 years ago

AldenB0 commented 2 years ago

I came here to ask the same question. I just attempted to implement an animation that I had built out a few months ago using the "chain" mode, and it appears that it doesn't work. I attempted a few workarounds but It doesn't seem like you can get the same effect while still using lottie-react. Would love to be proven wrong or have this feature added in the future. Animations are severely limited without it.

samuelOsborne commented 1 year ago

Hi @g1sbi , @AldenB0 the official dotLottie player supports both JSON and .lottie animations, but also includes state machine support. Creating your own state machines allows you to easily define simple or complex interactive scenarios.

You could drop your .json on our dotLottie playground

And then define your state machine in the 'states' panel. Documentation for state machine creation is available here, but let me know what sort of interactions you want to create and I can help out.

Once you create your .lottie and state machine, all you have to do is use the official dotLottie player and use the 'activeStateId' prop.