VaelisDocs
v1.0.0
Components · v1.0.0

Joint2D

Vaelis 1.0.0 Joint2D component reference: fields, script API, behavior and examples.

View as Markdownllms.txt
ScopeThis page documents the Joint2D component in Vaelis 1.0.0. Runtime fields are serialized scene data; the Script API section lists only members intentionally exposed to game scripts.
Where to find it in the editorInspector → Add Component → Joint 2D; choose Fixed/Revolute/Prismatic/Rope/Spring and configure anchors/limits/motor.

#What it does

Connect physics bodies with Fixed, Revolute, Prismatic, Rope or Spring constraints.

Component setup & editor toolsJoint2D constrains one physics body relative to another and requires compatible Rigidbody2D setup.

#How to add and use Joint2D

Editor path: Select the target entity in the Hierarchy (left side) → look at the Inspector (right side) → click Add Component at the bottom of the Inspector → search for Joint2D → click the component row. The Add Component picker is a centered modal with a search box; it only lists components not already attached.

For components with a dedicated editor tool, the tool is opened or activated from the location described below. Do not assume that adding the component alone activates its editor; some systems require a separate window, panel, or viewport tool.

#Component setup & editor tools

  • Select entity → Inspector → Add Component → Joint 2D. Configure the joint from its Inspector section and make sure the connected physics bodies satisfy the joint’s requirements.

#What you should see after adding it

The component appears as its own section in the Inspector. Its serialized settings are listed in the Component data table below. If a field is conditional, it appears only when the relevant mode/type is selected. If a field is a runtime state field (for example grounded or resolved velocity), treat it as read-only diagnostic state unless the API reference explicitly documents it as writable.

#How to read the settings

For every setting below, the documentation distinguishes type, default, meaning, and tuning direction where behavior is known. When a value represents a direction, use the engine's coordinate convention documented in Coordinate system; do not substitute Unity/Godot conventions.

#Component data

FieldTypePurposeDefault
jointTypeenumFixed | Revolute | Prismatic | Rope | Spring.Revolute
connectedEntityIdstring|nullEntity ID of the connected body, or null for a world anchor.null
anchor1XnumberLocal anchor X on this entity.0
anchor1YnumberLocal anchor Y on this entity.0
anchor2XnumberLocal anchor X on the connected body/world anchor.0
anchor2YnumberLocal anchor Y on the connected body/world anchor.0
axisXnumberPrismatic axis X.1
axisYnumberPrismatic axis Y.0
lengthnumberRope maximum length or Spring rest length.100
stiffnessnumberSpring stiffness.6000
dampingnumberSpring damping.18
flexibilitynumberRevolute only: how freely the connected body may rotate.100
segmentCountintegerRope/Spring visual/physical segments.18
ropeMassnumberMass per rope/spring segment.0.5
visualEnabledbooleanEnable visual joint rendering.true
visualColorhex stringJoint/rope visual color.#c8a66a
visualThicknessnumberVisual thickness.3
useTexturebooleanUse texture for rope-like visuals.false
textureKeystring|nullTexture asset key.null
textureModeenumstretch | tile.stretch
textureTilingnumberTiling length.32
textureScalenumberTexture scale.1
textureOffsetnumberTexture offset.0
textureFlipbooleanFlip texture.false
limitsEnabledbooleanEnable joint angle/position limits where supported.false
limitMinnumberMinimum limit.-45
limitMaxnumberMaximum limit.45
motorEnabledbooleanEnable motor.false
motorSpeednumberMotor target speed.0
motorMaxForcenumberMaximum motor force.0
jointDragnumberRevolute-only passive rotational response.0
restStiffnessnumberSee the Inspector field of the same name.0
breakablebooleanRevolute-only structural failure.false
breakForcenumberSee the Inspector field of the same name.10000
disableConnectedCollisionbooleanWhen enabled, only this joint's two connected entities stop generating contact pairs with one another.false
collideConnectedbooleanAllow connected bodies to collide.undefined
enabledbooleanEnable the joint.true

#Tuning behavior

These are the practical direction-of-change rules for the most important controls on this component.

SettingWhat changing it does
lengthFor Rope/Spring, higher length increases the rest/maximum link distance depending on the joint type.
stiffnessFor Spring, higher values pull toward the rest length more strongly.
dampingHigher damping reduces oscillation faster.
segmentCountRope visual/solver subdivision count; higher can look smoother but costs more.

#Breakable joints and drag

  • breakable / breakForce (Revolute only): when the joint load exceeds breakForce the joint snaps apart. Script joint.breakable and joint.breakForce.
  • jointDrag and restStiffness (Revolute only): drag/damping and the springiness that pulls the joint back to its rest pose.
  • disableConnectedCollision: stop the two connected bodies from colliding with each other. It replaces the old collideConnected field, which is kept only for loading older projects.

#Script API

MemberKindDescription
jointTypePropertyJoint type.
connectedEntityPropertyConnected entity context, when one exists.
anchor1Property{x,y} local anchor on this body.
anchor2Property{x,y} local anchor on connected body/world anchor.
axisProperty{x,y} prismatic axis.
lengthPropertyJoint length/rest length.
stiffnessPropertySpring stiffness.
dampingPropertySpring damping.
segmentCountPropertyRope/spring segment count.
ropeMassPropertyRope/spring segment mass.
visualEnabledPropertyVisual enabled.
visualColorPropertyVisual color.
visualThicknessPropertyVisual thickness.
useTexturePropertyUse texture.
textureKeyPropertyTexture asset key.
textureModePropertystretch | tile.
textureTilingPropertyTexture tiling.
textureScalePropertyTexture scale.
textureOffsetPropertyTexture offset.
textureFlipPropertyTexture flip.
limitsEnabledPropertyLimits enabled.
limitMinPropertyMinimum limit.
limitMaxPropertyMaximum limit.
motorEnabledPropertyMotor enabled.
motorSpeedPropertyMotor speed.
motorMaxForcePropertyMaximum motor force.
collideConnectedPropertyCollision between connected bodies.
enabledPropertyJoint enabled.
breakForcePropertyAvailable on this module.
breakablePropertyRevolute-only: enables structural breaking when estimated joint demand exceeds breakForce.
disableConnectedCollisionPropertyAvailable on this module.
jointDragPropertyRevolute-only passive rotational drag/damping.
restStiffnessPropertyRevolute-only torsional stiffness toward the joint's creation/rest angle.

#Examples

js
this.joint.connectedEntity = findFirst("Target");
js
this.joint.jointType = "Spring";
Need the full workflow?Components: complete workflow covers adding, configuring, testing, combining, and removing components.