Additional SDK integrations — parameter sliders and other advanced topics
The parameter{} element lets educators place interactive sliders in a scene's detail panel. When a student moves a slider, the runtime resolves the new value and delivers it to any element in the same panel whose attribute references that variable.
The educator places a parameter{} in the same detail panel as the plugin and references the variable letter in the plugin's attribute:
When the student moves the Particle Count slider, the runtime resolves n to the new numeric value and delivers the full updated attributes object to the plugin via onAttrsUpdate.
Parameter variable names must be single lowercase letters. The plugin always receives the resolved numeric value — it never sees the variable name itself.
Registers a handler that fires whenever the resolved value of one or more attributes changes because a parameter slider was moved.
handler (function; required). Called with the complete attributes object — the same shape as InitContext.attrs.voidThe attributes object in onAttrsUpdate is the full resolved set — not just the changed keys. Treat it as a complete snapshot of all current values.
onAttrsUpdate only fires when a parameter-driven attribute changes. Attributes set to static literals never trigger it and do not change at runtime.
Keep a local reference updated by both onInitialize and onAttrsUpdate and read from it in your render loop to avoid stale-closure bugs: