ReferenceScripting APIStagejoin
Stage.join
methodJoins two motes' bodies.
| Name | join |
|---|---|
| Kind | method of Stage |
| Called as | stage.join(…) |
| As a node | Make Joint (logic graph) |
| Since | 0.4 |
Syntax
join( a: string | Mote, b: string | Mote, joint?: MotionJointSpec): numberParameters
| Name | Type | Description |
|---|---|---|
a | string | Mote | One mote (or its id) |
b | string | Mote | The other |
joint | MotionJointSpec | Optional. 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
Notes from the community
Written by creators and checked by the docs' editors. Not part of Motion's official reference.