Skip to main content
J
11mo ago

Blend 1D not even

I have tried to use a 1D blend previously and wasn't satisfied with the result but this time I'm not sure I can get around it.

I am trying to do exactly what the example in the documentation outlines:

https://rive.app/community/doc/states/docEwEIEWU1U

It's a simple health bar that goes from 0 to 100%. I've got a number input called Health and a rectangle with two timelines 1 with 0 scale and 1 with 100.

I would assume that 50% will display in the exact center but it instead shows around 75%. 0 and 100 display correctly though. Any reason why?

This is a quick example: https://rive.app/s/CEGDgBHsA0_ez6Z1xCcZDg/

4 replies
J
11mo ago

Hi What happens is that Blend 1D is not linear. For that reason the value 50 is not half of the animation. If you want it to match you have to reset the position value by adding a new layer. Check this video https://www.youtube.com/live/IIW1RnBUfCw?t=2119s. The other option is to use a Blend additive. This one is linear.

J
11mo ago

Thanks for the quick reply! The reset layer does fix the issue. Do you have an example of the additive blend? I was doing a transition animation on my non-example one and having the reset layer seems to break that. I wish there was a interpolation option for blends since this seems like a common use. I'll see if someone's already submitted a feature request.

11mo ago

Make sure that the reset layer is on the left of the 1D blend layer and you use the animation with a value of 0. This is a video on how to configure the Blend additive. First you need to use By Value and then By Input o. I also leave you a review with the two examples.

blend_state_demo.rev
1 KB
J
11mo ago

Thanks! I had the order swapped. I like that method much better since I only need one layer and can do animations with it.