Log inGet started
◇
component · drop-in viewer
asset⌬ componentcomponentprimary: init.luau·originates fromworld 07158574-5…

Joint

Connects two physics bodies with a joint constraint. Both entities must have `Physics` components.

byzero-proxy @ DESKTOP-DB3UJOJ·posted 2mo ago
What it does

Joint

Connects two physics bodies with a joint constraint. Both entities must have Physics components.

Joint kinds: "fixed", "hinge", "ball", "prismatic", "spring", "rope".

Public fields: kind, connected, localAnchorX/Y/Z, remoteAnchorX/Y/Z, axisX/Y/Z, stiffness, damping, restLength, maxDistance.

Methods: :setMotor(targetVelocity, maxForce).

entity(id).component.add("Joint", {
    connected = frameEntityId,
    kind = "hinge",
    axis = {0, 1, 0},
})

A "rope" joint is a hard maximum-distance limit solved inside the physics step: the bodies move freely while the anchors are closer than maxDistance (slack rope) and are stopped from separating beyond it (taut rope). It requires maxDistance > 0, and maxDistance is reactive — writing it on a live joint retunes the limit in place, so a winch can reel a rope in or out without recreating the joint.

entity(ballId).component.add("Joint", {
    connected = hookEntityId,
    kind = "rope",
    maxDistance = 8,
})

Interface

What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.

conforms to

zero/source-extract/v2

Joint Component Connects two physics bodies with a joint constraint. Both entities must have Physics components. Joint types: "fixed" — no relative motion allowed (rigid connection) "hinge" — rotation around a single axis (door hinge, wheel axle) "ball" — free rotation around a point (shoulder, pendulum) "prismatic" — linear sliding along an axis (piston, slider) "spring" — spring-damper connection (suspension, elastic) "rope" — maximum-distance limit (rope, chain, tether): bodies move freely while the anchors are closer than maxDistance and are hard-stopped from separating beyond it; requires maxDistance > 0. maxDistance is reactive — writing it on a live joint retunes the limit in place (winch reel-in/out). Config is the native PhysicsJoint ECS component (typed ecs.PhysicsJoint API); the motor is driven through physics.setJointMotor. Usage: entity.find("door").component.add("Joint", { connected = "frame_entity_id", kind = "hinge", axis = {0, 1, 0}, })

capitalize(s: ?) → void

argtypedescription
s?

resolveConnectedId(target: ?) → void

Resolve a connection target to a native entity ID. Accepts: * an entity ID (`ent_xxxx`) — returned as-is * an entity name — resolved via entity.find() to its ID entity.find returns the first matching proxy, or nil. Returns the original literal if no match is found — the native side will then produce a meaningful error rather than the wrapper failing silently.

argtypedescription
target?

jointValue( ) → void

Build the typed ecs.PhysicsJoint value. anchors and axis are single Vec3 fields packed from the per-channel public fields.

insertNative( ) → void

awake( ) → void

update( ) → void

Deliver whatever the simulation broke this tick. Every live Joint drives the same shared pump, which does its work once per frame however many call it.

editorUpdate( ) → void

onPropertyChanged(key: ?, value: ?, oldValue: ?) → void

argtypedescription
key?
value?
oldValue?

onDestroy( ) → void

setMotor(targetVelocity: number, maxForce: number) → void

Drive the joint motor (hinge/prismatic only).

argtypedescription
targetVelocitynumberTarget velocity for the motor.
maxForcenumberMaximum force the motor can apply.

examples

joint:setMotor(5.0, 1000)

onBreak(fn: (table) → void

Call `fn` when this joint breaks, with the record describing the break. A joint breaks when the reaction it carries exceeds `breakForce` or `breakTorque`; it reports once and its constraint is already released.

argtypedescription
fn(tableReceives `{ entityId, connectedEntityId, kind, impulse, angularImpulse, force, torque, position }`.

examples

joint:onBreak(function(e) print(e.force, e.position.x) end)

isBroken( ) →

Whether this joint has broken. Read from the simulation's own state, so it answers for the constraint itself however the break record was routed.

examples

if joint:isBroken() then spawnDebris() end

breakEvent( ) →

The record of this joint's break, or `nil` while it still holds.

examples

local e = joint:breakEvent(); if e then print(e.force) end

reattach( ) → void

Rebuild a broken joint's constraint and arm it against its thresholds again. The constraint comes back at the anchors it was authored with, so move the two bodies back to where those anchors coincide first — reattaching bodies that have drifted apart hands the solver the separation to correct, and that load breaks the joint again on the next step.

examples

entity(id).position = restPosition; joint:reattach()

Sub-parts

Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.

3items
·
other · born here
▤file
▲ 0↑ born
backing path · components/Joint.component

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

0problems
No problems reported. This asset, its contents, and its direct deps are clean as of the latest commit.
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ quality × 0.35
+ performance × 0.25
± compat factor

Usability ratings

Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.