For more information on creating Inputs in Rive, please refer to: Inputs.Documentation Index
Fetch the complete documentation index at: https://rive-accessibility.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Controlling state machine inputs
Once the Rive file is loaded and instantiated, the state machine can be queried for inputs, and these input values can be set, and in the case of triggers, fired, all programmatically.Inputs can also be set on components at runtime, see Nested
Inputs below.
Inputs
Setting input values for state machines goes through theRiveViewModel instantiated in the View class.
.setInput()
inputName(String) - Name of the input on a state machine to set a value forvalue(Bool, Float, or Double) - value to set for the associatedinputName
triggerInput()
inputName(String) - Name of the input on a state machine to trigger
Nested Inputs
You can control the inputs of Components at runtime. These inputs are not on the main artboard but on a component. To set a nested input, you need to know the path where the input exists at an artboard level.Example
Volume ComponentFX Component
Once you go more than one component deep the path will be a
/ separated
string of the unique hierarchy names.FX Component artboard, the path will be Volume Molecule/FX Component
To set the Volume input for the above example:
setInput(_ inputName, value: value, path)wherevaluecan be aBool,Double, orFloattriggerInput(_ inputName, path: path)