Motion
Get Motion

ReferenceScript nodesUtilities › Flow Control

Throttle

Goes on at most once in the seconds, and once more at the end so the last call isn't lost.

Inputs

PinTypeStarts atNotes
inwhat happens next––
Durationsecondsnumber1–

Outputs

PinType
thenwhat happens next

The code it becomes

The graph below written as a script would write it.

let q2 = { t: -1e9, waiting: false };// On Scene Start{    const secs = Math.max(0.1, 1);    if (scene.time - q2.t >= secs) {        q2.t = scene.time;    } else if (!q2.waiting) {        q2.waiting = true;        scene.after(secs - (scene.time - q2.t), function () {            q2.waiting = false;            q2.t = scene.time;        });    }}

In a graph

The node with what starts it and Print to show what it gives, as Studio draws them.