🪛 In Progress: Trouble Triggering Animation from Code Using ViewModel
Hello Rive Support Team,
I'm working with a .riv file in a web project using the @rive-app/webgl2 runtime. I’m trying to trigger an animation using a Trigger input that was set up in the State Machine. Here's what I'm doing:
trigger.fire();
or:
trigger.value = true;
But the animation doesn’t play. From what I understand, triggers defined in the ViewModel may not be manually fired via code.
Could you please clarify:
Is it possible to fire a Trigger defined in the ViewModel from the web runtime?
If not, would replacing the Trigger input with a Boolean input and updating the State Machine logic accordingly allow me to control the animation via input.value = true/false?
Is fireStateAtPath() a valid method in this context, or is it only applicable to raw state machines, not ViewModel-based flows?
I want to ensure we're structuring the animation correctly to allow code-based interaction. Any guidance or best practices would be greatly appreciated.
Thank you!
Best regards,
Tymur