ReferenceScripting APIMotionLayeranimate
MotionLayer.animate
methodMoves one of this layer's number or colour settings smoothly.
| Name | animate |
|---|---|
| Kind | method of MotionLayer |
| Called as | scene.layer(…).animate(…) |
| As a node | Move Layer Setting To (logic graph) |
| Since | 0.3 |
Syntax
animate( setting: string, value: string | number, seconds: number, options?: MotionAnimateOptions): Promise<boolean>Parameters
| Name | Type | Description |
|---|---|---|
setting | string | A number or colour setting |
value | string | number | Where it ends up |
seconds | number | How long the move takes |
options | MotionAnimateOptions | Optional. 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
Notes from the community
Written by creators and checked by the docs' editors. Not part of Motion's official reference.