Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The state machines does not work in this version. #81

Open
polaris7765 opened this issue Dec 16, 2024 · 9 comments
Open

The state machines does not work in this version. #81

polaris7765 opened this issue Dec 16, 2024 · 9 comments

Comments

@polaris7765
Copy link

"rive version": "0.3.1-canary.26"
"unity version:" "2022.3.49f1c1"

`private void SetValue(string numberName, int num)
{
var mStateMachine = m_rive_file.Artboard.StateMachine(0);
var input = mStateMachine.GetNumber(numberName);
input.Value = num;
}

private void Update()
{
if (m_stateMachine != null)
{
m_stateMachine.Advance(Time.deltaTime);
}
}
`
i see input value was set correctly, but the rive state was not change.

@damzobridge
Copy link
Contributor

Hi, does this also happen with the v0.2.1 release?

@polaris7765
Copy link
Author

i used urp pipeline, it's looks like v0.2.1 does not support urp?

@polaris7765
Copy link
Author

Because v0.3.1 have Rive Panel and Rive Widget, we can easily add rive animation to UGUI.
but we also find the rive rendered will extra add a black outline.
image

@damzobridge
Copy link
Contributor

damzobridge commented Dec 17, 2024

Ohh I see! When using the RivePanel and RiveWidget, you no longer need to call advance() or instantiate the statemachine yourself like you're doing with m_rive_file.Artboard.StateMachine(0);. The RivePanel will automatically advance all the RiveWidgets.

In your script, you can take a reference to the rive widget:

        [SerializeField] private RiveWidget m_riveWidget;
        
        void Start()
        {
        
             if (m_riveWidget.Status == WidgetStatus.Loaded)
            {
               var input = m_riveWidget.StateMachine.GetNumber(numberName);
               input.Value = num;
            }
        }
   

In your current script, you're creating a new state machine rather than using the reference in the widget, so you won't be able to see any changes because they're being applied to a different statemachine.

We will have documentation available for the RivePanel and RiveWidget this week.

@damzobridge
Copy link
Contributor

Are you able to share the .riv/rev file with us so we can take a look at the outline issue?

If you don't want to share it publicly, you can also send it to us privately here.

@polaris7765
Copy link
Author

Ohh I see! When using the RivePanel and RiveWidget, you no longer need to call advance() or instantiate the statemachine yourself like you're doing with m_rive_file.Artboard.StateMachine(0);. The RivePanel will automatically advance all the RiveWidgets.

In your script, you can take a reference to the rive widget:

        [SerializeField] private RiveWidget m_riveWidget;
        
        void Start()
        {
        
             if (m_riveWidget.Status == WidgetStatus.Loaded)
            {
               var input = m_riveWidget.StateMachine.GetNumber(numberName);
               input.Value = num;
            }
        }
   

In your current script, you're creating a new state machine rather than using the reference in the widget, so you won't be able to see any changes because they're being applied to a different statemachine.

We will have documentation available for the RivePanel and RiveWidget this week.

Perfect, it's works now. thanks for your help.
so, where can i see the up to date API document?

@polaris7765
Copy link
Author

Are you able to share the .riv/rev file with us so we can take a look at the outline issue?

If you don't want to share it publicly, you can also send it to us privately here.

I had send You a .riv file by the privately link (RIV-7607).
please check this problem, thanks for your help.

At the beginning i want use a shader to fix this problem as before, but in this version it' not easy to apply that.

@damzobridge
Copy link
Contributor

so, where can i see the up to date API document?

This will be available here later this week

Regarding the outline issue, is this what you're referring to (the dark lines around the finger edges):

Screenshot 2024-12-17 at 9 14 21 AM

@polaris7765
Copy link
Author

polaris7765 commented Dec 18, 2024

so, where can i see the up to date API document?

This will be available here later this week

Regarding the outline issue, is this what you're referring to (the dark lines around the finger edges):

Screenshot 2024-12-17 at 9 14 21 AM

Yes, how can i solve this problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants