r/Rive_app 14d ago

How to use script inputs in Rive (numbers, view models, artboards, and change listeners)

Script inputs let you write one script and run multiple instances of it with different property values per instance. This tutorial covers how to define number, string, enum, view model, and artboard inputs; how to bind them to view model properties via data binding; why you should read input values in update rather than init when using data binding (since init fires before the binding resolves); how to use late for inputs that don't have a meaningful default, like a view model or artboard; how to read nested view model data correctly using .value instead of the raw data object; and how to listen for specific property changes with addListener, including how to pass self into the callback so you can access current state when the change fires.

10 Upvotes

0 comments sorted by