timer
interaction · 5 properties · Other
Counts simulation time down and emits timeout from this node when it runs out: [[nodes.bindings]] event = "emitted:timeout" answers it, and so does a script subscribed to it. Set running to start it.
In a scene, timer is the node key that applies it. A script reaches each property below as a field on node.timer: reading one asks the running component, and assigning one leaves the rest alone. The whole table is node.timer.get() and node.timer.set(table).
Properties
| property | type | default | description |
|---|---|---|---|
autostart | bool | false | Start counting as soon as the node is in the scene |
one_shot | bool | false | Stop after one timeout; off, count the next one at once |
running | bool | false | Whether it is counting; set true to start it from wait_time, false to stop it |
time_left | float | 0 | Seconds until the next timeout Read-only: engine output the inspector shows but never writes. At least 0. |
wait_time | float | 1 | Seconds from starting to timeout At least 0.001. |