Skip to main content
3mo ago

Mismatch between value passed in from React received as input value

I have a 1d blend with 2 timelines that blend based on a value (`parallax`) between 1 - 100. When I run it in Rive and change the value manually, everything works as expected - A value of 0 shows the parallaxLeft timeline, a value of 100 shows the parallaxRight timeline. Any value in between blends as expected.

When I pass the value in from React, a value of around 80+ is treated as the same as a value of 100 in Rive, meaning it only shows the parallaxRight timeline.

Notice in the first video (in Rive) that when I update the value between 90 - 100, there's a change in the parallax.

Notice in the second video (in browser) that when the value is between 90 - 100, nothing moves. I'm also updated the text run with the same value to show that the value is correct.

What I've tried

  • I thought it might be an issue with the blend state so I've tried adding a reset layer and turning capture base state on/off.

  • I've done a bunch of testing to see if I'm setting the value incorrectly, but I'm pretty sure I'm not.

  • I've tried turning it off and on again, re-exporting a few times.

  • I thought it might be related to the fact that I'm setting the parallax value in the main artboard, which blends 2 timelines that are setting parallax values in nested artboards, which also have blend states. I still see the issue even if I export just the nested artboard and modify its parallax value directly.

4 replies
3mo ago

Hey Lance! Just to clarify, the blends works as expected inside the Rive Editor, correct?

3mo ago

Yep, that's right. It's kinda hard to notice, but you can see the diff in the 2 vids I posted.

(edited) 3mo ago

hey! I noticed that the project is loading a 5 months old version of rive (wasm version 2.10.1). I tried the project with the latest version (wasm v.2.19.4) and it seems to work correctly.
Can you try updating the library and see if the issue is fixed?

3mo ago

omg, I can't believe I didn't think of that. Thanks !