menu_bookDocumentation

Sandbox: Weld tool — FixedJoint constraint with EasyMode rotation

calendar_today May 4, 2026 schedule ~2 min read person patrickjr verified 50

Sandbox Weld Tool — Constraint Creation with EasyMode Rotation

The Weld tool creates FixedJoint constraints between two GameObjects. It has an EasyMode that lets the player rotate the weld angle with the mouse before confirming.

Stages

The tool operates in 3 stages:

  1. Stage 0 — Select the first object (primary click)

  2. Stage 1 — Select the second object (primary click)

  3. Stage 2 (EasyMode only) — Rotate the weld angle with the mouse, confirm with primary click

Properties

PropertyTypeDefaultDescription
EasyModebooltrueEnables the rotation stage before confirming
RigidboolfalseIf true, AngularFrequency and LinearFrequency are set to 0 (perfectly rigid)

Constraint structure

When a weld is created, two child GameObjects are spawned — one parented to each welded object:

CODE
point1.GameObject
  └── "weld" (go1)
        ├── ConstraintCleanup (attachment = go2)
        └── FixedJoint (body = go2, EnableCollision = true)

point2.GameObject
  └── "weld" (go2)

EasyMode rotation

When EasyMode is on and both points are selected, AbsorbMouseInput returns true — the camera stops moving and Input.AnalogLook is used to rotate the weld angle. The moving object's WorldTransform is updated live as the player rotates.

Removing welds

Reload (R) removes all welds between the aimed object and any connected object. The tool finds welds via FixedJoint components in children with a matching ConstraintCleanup.Attachment.

Undo

Both go1 and go2 are added to the undo entry — undoing destroys both constraint GameObjects, which also removes the joint.

Snap grid integration

When a snap grid is active, SelectionPoint local positions are snapped to the nearest grid corner before the constraint is created.

Was this helpful?