Motion
Get Motion

ReferenceScripting APIMotionScenelayer

MotionScene.layer

method

One layer, to change without naming it each time.

Namelayer
Kindmethod of MotionScene
Called asscene.layer(…)
As a nodeFind Layer by Name (logic graph)
Since0.3

Syntax

layer(name: string): MotionLayer

Parameters

NameTypeDescription
namestringThe 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

MotionLayer