Motion
Get Motion

ReferenceScripting APIMotionLayeranimate

MotionLayer.animate

method

Moves one of this layer's number or colour settings smoothly.

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

Syntax

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

Parameters

NameTypeDescription
settingstringA number or colour setting
valuestring | numberWhere it ends up
secondsnumberHow long the move takes
optionsMotionAnimateOptionsOptional. Its easing ("easeInOut" unless given), delay and loop

Returns

Promise<boolean>: a promise of true when it gets there, false when it's stopped or another 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.

See also

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