Page 1 of 1

Rive State Machine broke

Posted: 03 Jan 2024, 15:40
by peanut
Hello,

I went to test the Rive and made an animation to see how it works, here is it in action:
https://www.dropbox.com/scl/fi/x2q8ntzq ... 17vpk&dl=0
As you can see it works nicely, spins up, keeps spinning while you hover, then spins down on hover exit.
Then I went back to Rive app to make it faster, exported again and the state machine / file stopped working correctly:
https://www.dropbox.com/scl/fi/ojh28cux ... fp0if&dl=0
For comparison this is from Rive app where it works as it should:
https://www.dropbox.com/scl/fi/65khllo0 ... rto6e&dl=0

I tried fiddling in Rive app to see where exactly it went wrong but had no luck. I only have .riv files at this point, so I attached them both if it helps.
Thanks for taking a look.

Re: Rive State Machine broke

Posted: 03 Jan 2024, 16:21
by peanut
Aha I found I can post it to community if you need the check how its made: https://rive.app/community/7388-14194-spinning-reel/

Re: Rive State Machine broke

Posted: 09 Jan 2024, 12:07
by sfernandez
This doesn't look like a Noesis problem but a question of how to use Rive itself, right?
Is the the state machine working as expected in the Rive editor? If not you should probably ask in their community forums about what could be happening.

Re: Rive State Machine broke

Posted: 09 Jan 2024, 16:44
by peanut
It works fine in Rive thou, its recorded in the third link in the original post and if you check the second link you can see how it behaves in unity.

Re: Rive State Machine broke

Posted: 09 Jan 2024, 17:31
by sfernandez
I've opened the https://rive.app/community/7388-14194-spinning-reel/ link in the Rive editor and I don't see any Listeners set up for updating the Hover input variable.
It works if you manually change the Hover input value in the editor, but not if you move your mouse over the artboard (it doesn't work either in the Rive Community webpage linked). I think you are missing those listeners (they probably got deleted when you modified the rive and exported it again).

Re: Rive State Machine broke

Posted: 09 Jan 2024, 23:09
by peanut
Hello, I am not using listeners, I trigger hover in xaml:
<noesis:RiveControl x:Name="rive"
                    Width="16"
                    Height="16"
                    Source="{TemplateBinding noesis:RiveControl.Source}"
                    Stretch="Uniform"
                    Tag="0">
    <noesis:RiveInput InputName="Hover"
                      InputValue="{Binding Tag, ElementName=rive}" />
</noesis:RiveControl>
and then change Tag:
<Trigger Property="IsMouseOver" Value="True">
    <Setter TargetName="rive" Property="Tag" Value="1" />
I went and recreated the file so it worked again, then I noticed what I changed and it is the curve weights, if you change the handles from Cubic to Cubic Handles first problem appears, the easing issue, since on Cubic Handles it treats it as linear.
Still didn't manage to "break" the State Manager like the first time...

So to recap, this is fine:
.
Screenshot 2024-01-09 230230.png
.
And this is not (result is linear whatever you set the handles):
.
Screenshot 2024-01-09 230133.png
.
I will try to mess it with more to see what triggers the state machine issue.

Here is the working file, you can double check its identical setup as first one: https://rive.app/community/7476-14363-spinning-reel-v2
And it works fine if you use it like the code I pasted above.

Re: Rive State Machine broke

Posted: 10 Jan 2024, 11:59
by jsantos
Thanks for the details, I think this is happening because 3.2.2 is using a year-old Rive runtime. We have updated to a recent version in 3.2.3. Please, try it once this version is released.

Re: Rive State Machine broke

Posted: 10 Jan 2024, 17:27
by peanut
Good to know, thank you!