ReferenceScripting APIMotesetTimer
Mote.setTimer
methodRuns a function after seconds (and every seconds, looping): seconds first, as scene.every has them.
| Name | setTimer |
|---|---|
| Kind | method of Mote |
| Called as | scene.pickItem(…).setTimer(…) |
| Since | 0.3 |
Kept for older scripts. give the seconds first: setTimer(seconds, fn), as scene.every has them
Syntax
setTimer( seconds: number, fn: () => void, options?: { looping?: boolean }): numbersetTimer( fn: () => void, seconds: number, options?: { looping?: boolean }): numberParameters
| Name | Type | Description |
|---|---|---|
seconds | number | How long |
fn | () => void | What runs |
options | { looping?: boolean } | Optional. Looping: run again and again |
Returns
number: an id, for clearTimer.
Remarks
(fn, seconds) works too.
Notes from the community
Written by creators and checked by the docs' editors. Not part of Motion's official reference.