Best Practice for Scroll-Controlled Animation in the Latest Rive Runtime

Hi everyone,

I'm trying to create a scroll-controlled animation in Rive.

My setup is very simple: one artboard, one timeline, and one state machine with a basic linear animation. My goal is for the animation to be driven by the user's scroll position, similar to scroll-based animations on modern websites.

For example:

  • When the page is scrolled to 25%, the animation should be at 25% of its timeline.

  • At 50% scroll, the animation should be at 50%.

  • At 100% scroll, the animation should reach the end.

I understand this would be controlled through code, but I'm wondering what the recommended approach is with the latest Rive runtime.

Can a developer directly control the animation timeline or playhead based on the scroll percentage? If so, what is the best practice?

Also, how should I set up my Rive file so it's easy for a developer to implement this? For example, should I use a state machine, a linear animation, a ViewModel, data binding, or another workflow? I'd like to prepare the .riv file in the best way so the developer can achieve this scroll-driven behavior.

Any advice, examples, or recommended workflows would be greatly appreciated. Thanks!