ReferenceScripting APIMotionScenelayer
MotionScene.layer
methodOne layer, to change without naming it each time.
| Name | layer |
|---|---|
| Kind | method of MotionScene |
| Called as | scene.layer(…) |
| As a node | Find Layer by Name (logic graph) |
| Since | 0.3 |
Syntax
layer(name: string): MotionLayerParameters
| Name | Type | Description |
|---|---|---|
name | string | The layer's name or id: an id first, then the lowest layer of that name |
Returns
MotionLayer: the layer.
Remarks
A name several layers share names the lowest of them, and the console says so once (use an id, or layersNamed). A layer that isn't there gives one that does nothing (exists is false).
Example
const sun = scene.layer("Sun");sun.animate("x", 0.2, 3);See also
Notes from the community
Written by creators and checked by the docs' editors. Not part of Motion's official reference.