Skip to content

Search

Documentation

task

Waiting inside an async method: init and event handlers may await; update is synchronous.

On this page

Waiting inside an async method: init and event handlers may await; update is synchronous.

3 functions, 0 constants. Scripts reach it as task::.

Functions

Argument kinds are the script values a call passes: node is a node handle, any a table or value of any kind, fn a callback.

function acts on what it does
frames(int) — Park an async method for a number of fixed steps; counted on the tick, so a replay waits exactly as long.
seconds(float) — Park an async method for a span of simulation time, woken on fixed step ceil(seconds * tick_hz), so 4/60 at 60 Hz is 4 steps; the wall clock never enters it.
wait(int) -> any — Park an async method until the engine wakes the token a binding gave it, and answer what it woke with.

Are you sure?