states
Named looks for the node. Every key beside current is a state holding per-component property tables; node.states.set_state(\"hover\") patches one over the…
On this page
interaction · 1 property · Other
Named looks for the node. Every key beside current is a state holding per-component property tables; node.states.set_state("hover") patches one over the node at once.
In a scene, states is the node key that applies it. A script reaches each property below as a field on node.states: reading one asks the running component, and assigning one leaves the rest alone. The whole table is node.states.get() and node.states.set(table).
Properties
| property | type | default | description |
|---|---|---|---|
current |
string | — | The state this node is in; empty is the pose the scene gave it |
Script functions
Methods of node.states, the handle a node carrying this component exposes. Every handle also has get(), set(table), patch(table), has() and remove().
From node:
| method | what it does |
|---|---|
set_state(string) |
Put the node in one of its states: the state's table is patched over the components it names, and on_state_changed(from, to) follows. A node already in that state is left alone. |