Motion
Get Motion

ReferenceScripting APIMotionStageApijoin

MotionStageApi.join

method

Joins two motes' bodies.

Namejoin
Kindmethod of MotionStageApi
Called asstage.join(…)
As a nodeMake Joint (logic graph)
Since0.4

Syntax

join(    a: string | Mote,    b: string | Mote,    joint?: MotionJointSpec): number

Parameters

NameTypeDescription
astring | MoteOne mote (or its id)
bstring | MoteThe other
jointMotionJointSpecOptional. How: its kind, anchors, axis, length, stiffness and damping

Returns

number: its number, for unjoin (0 when one of them isn't there).

Remarks

Two bodies in different worlds, or without bodies, aren't joined: the console says why. A joint goes with either body. 1024 joints at most.

Example

import { stage } from "motion";const rope = stage.join("Lantern", "Hook", { kind: "rope", length: 120 });

See also

Mote · MotionJointSpec