Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

createJoint

createJoint(authority, body, options): Entity

Joins body to to, or to the world where to is left out, with a joint of type, on the world authority decides for, and returns the joint’s entity: the two bodies hold from the next physics step, the one of this tick for bodies spawned this tick. Its other anchor and its frames are resolved from where the bodies stand now, so a hinge’s zero angle is this pose. A page joins only bodies it holds alone, since no single solver holds a body the room simulates and one the page does.

Parameter Type
authority EntityAuthority
body Entity
options JointOptions

Entity

const hitch = createJoint(step, trailer, { type: JointType.BallAndSocket, to: kart, anchor: [0, 0.3, -1.2] });