Help with Syncing Rive State Machine to GSAP ScrollTrigger in Webflow

Hi everyone! I’m currently working on a Webflow project where I'm trying to control a Rive animation precisely with the page scroll using GSAP ScrollTrigger.

I am able to get the Rive animation to autoplay perfectly fine as soon as a user scrolls down and reaches that specific viewport section. However, what I cannot get to work is playing the Rive animation via scrub. The goal is to have the animation scrub forward and backward frame-by-frame based on the user's scroll position, rather than playing linearly on its own. Whenever I try to map it to the scrollbar, it completely stops rendering the rive.

I'm using a dedicated <canvas> container inside an embed block. Below is the exact JavaScript architecture I am using to bind the scroll position to the Rive input.

Could someone look at my code, or let me know what the common pitfalls are within the Rive State Machine setup (inputs, layers, or listeners) that could cause scroll scrubbing to fail? I have also attached the rive that I’m using for my project.

bathymetry_circlev3.riv



Thank you in advance!

const canvasElement = document.getElementById('rive-scroll-canvas');
if (canvasElement) {
  const riveEngine = new rive.Rive({
    src: 'YOUR_HOSTED_FILE_URL.riv',
    canvas: canvasElement,
    autoplay: true,
    stateMachines: 'State Machine 1',
    onLoad: () => {
      riveEngine.resizeDrawingSurfaceToCanvas();

      const smInputs = riveEngine.stateMachineInputs('State Machine 1');
      const scrollProgressInput = smInputs.find(input => input.name === 'progress');

      if (scrollProgressInput) {
        const scrollProxy = { val: 0 };

        gsap.to(scrollProxy, {
          val: 100,
          ease: 'none',
          scrollTrigger: {
            trigger: '[section="control"]',
            start: 'top top',
            end: 'bottom bottom',
            scrub: 0.1,
            invalidateOnRefresh: true
          },
          onUpdate: () => {
            scrollProgressInput.value = scrollProxy.val;
          }
        });
      }
    }
  });

  window.addEventListener('resize', () => {
    if (riveEngine) {
      riveEngine.resizeDrawingSurfaceToCanvas();
    }
  });
}