Motion
Get Motion

ReferenceScripting APIMotionSceneanimate

MotionScene.animate

method

Moves a number or a colour setting to a new value smoothly, over some seconds.

Nameanimate
Kindmethod of MotionScene
Called asscene.animate(…)
As a nodeMove Layer Setting To (logic graph)
Since0.3

Syntax

animate(    layer: string,    setting: string,    value: string | number,    seconds: number,    options?: MotionAnimateOptions): Promise<boolean>

Parameters

NameTypeDescription
layerstringThe layer's name or id, or a folder's
settingstringA number or colour setting
valuestring | numberWhere it ends up
secondsnumberHow long the move takes
optionsMotionAnimateOptionsOptional. Its easing ("easeInOut" unless given), delay (seconds) and loop (true, or "pingpong")

Returns

Promise<boolean>: a promise of true when it gets there, false when it's stopped or a move or set of the same setting takes over.

Remarks

A layer that isn't there does nothing (the console says so once), and the promise gives false. A move that loops never gets there.

Example

await scene.animate("Moon", "y", 0.2, 4, { easing: "sineInOut" });scene.animate("Glow", "opacity", 1, 1);

See also

MotionAnimateOptions · In examples: Constellations, Kelp Forest, Rain Harbour, Resonance, Valley Hours