State Machine Simple Toggle - How to stop midway when changing input value and immediately "flow...
Hi everyone,
I’m not a motion designer, but I’m doing a talk about Rive in some React conference (on December 15th, 2025).
I built a very very simple animation that toggles between day and night using a state machine.
When I click day and then night, the “next“ animation waits for the previous animation to end.. and it looks un-reactive or unresponsive.
I want to get to a situation when a user clicks on night or day, the animation stops midway and immediately shows night/day in a smooth way.
Here is the file:
sun_and_moon2.rivHere is the state machine (extremely simple and naive):
Can I solve this? Can I do it without using extra features (like data-binding)?
I’d (please please please) appreciate any help! My talk is about convincing frontend developers to choose Rive over Lottie ☺️
My code:
https://github.com/itayperry/rive-lottie-talk/blob/main/03-rive-state-machine/index.html
**Update:
Adding “Allow exit during transitions” (clicking the checkbox) for both transitions didn’t help, animation looks janky.. and I’m willing to use data-binding if it’ll help ♥️ thank you for everyone who read this far!