Skip to main content

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

propertytypedefaultdescription
autostartboolfalseStart counting as soon as the node is in the scene
one_shotboolfalseStop after one timeout; off, count the next one at once
runningboolfalseWhether it is counting; set true to start it from wait_time, false to stop it
time_leftfloat0Seconds until the next timeout Read-only: engine output the inspector shows but never writes. At least 0.
wait_timefloat1Seconds from starting to timeout At least 0.001.