Skip to main content
Q
12d ago

Rive events not firing when `stateMachines` param not included

  1. I have a Rive animation that fires custom events in a Timeline that I listen to in the client side runtime to trigger some custom code. If I don't include stateMachines in the new Rive() config, the events do not fire. I'm not sure if this is a bug or not but it makes it so that even if my designer doesn't use State Machine at all, I have to pass that in. I can't reliably set a default value there because I can't guarantee the name of the default State Machine hasn't changed during design phase.

  2. I'm using @rive-app/canvas version 2.10.3. I'm using rive-wasm version 2.10.3. I'm working in Chrome.

  3. I can't really share code as its a proprietary project. However, the docs state that stateMachines is an optional parameter, I wouldn't expect this to be required just to use Rive events.

1 reply
12d ago

The events are fired via a state machine so yes, you will need to specify one in new Rive().