Skip to main content

Joint

The Joint Component constrains two rigid bodies, or constrains one rigid body to a fixed point in world space.

Alpha

The joint component is in alpha, so its behavior and API may change. The Editor inspector for it is available from Editor 2.32.

Prerequisites

The Joint Component is driven by the Ammo physics backend, so two things must be in place before it does anything:

  • Ammo must be imported into the project. Until it is, the component panel shows an Ammo module not found warning with an import button. See Physics for how to add it.
  • Both referenced entities need a Rigid Body Component, each with a Collision Component to give it a shape.

Leave Entity B empty to constrain Entity A to a fixed point in world space instead of to a second body.

Joint types

Type selects a fixed, ball, hinge, slider, or six degrees of freedom joint. The inspector options are Fixed, Ball, Hinge, Slider and 6DoF.

The type decides which of the remaining fields the inspector shows, so the panel changes as you switch between them:

TypeAdditional fields
FixedNone — only the always-shown properties.
BallEnable Limits, and the swing and twist limits when it is on.
HingeEnable Limits, Limits, Motor Speed, Max Motor Force.
SliderEnable Limits, Limits, Motor Speed, Max Motor Force.
6DoFThe per-axis Linear and Angular motion, limit and spring fields.

A chain of planks, each held to the next by a joint, launched from the Editor.

Properties

Always shown

PropertyDescription
TypeSelects a fixed, ball, hinge, slider, or six degrees of freedom joint.
Entity AFirst constrained entity. It must have a rigid body component.
Entity BSecond constrained entity. Leave empty to constrain Entity A to world space.
Enable CollisionAllow the two constrained bodies to collide with each other.
Break ImpulseImpulse above which the joint breaks. Leave empty for an unbreakable joint.

Limits

Enable Limits is shown for the Ball, Hinge and Slider types.

PropertyDescription
Enable LimitsEnable the configured hinge, slider, or ball-joint limits.

Hinge and Slider

Motor Speed and Max Motor Force do not depend on Enable Limits.

PropertyDescription
LimitsLower and upper angular hinge limits or linear slider limits. Only shown when Enable Limits is on.
Motor SpeedTarget angular hinge speed or linear slider speed.
Max Motor ForceMaximum motor force or torque. Set to 0 to disable the motor.

Ball

Only shown when Enable Limits is on.

PropertyDescription
Swing Limit YMaximum ball-joint swing towards its Y axis in degrees.
Swing Limit ZMaximum ball-joint swing towards its Z axis in degrees.
Twist LimitMaximum ball-joint twist about its X axis in degrees.

6DoF

The six degrees of freedom type replaces the fields above with a per-axis grid — Linear and Angular, each for X, Y and Z.

PropertyDescription
Linear Motion X / Y / ZSelects whether linear motion on that axis is locked, limited, or free.
Linear Limits X / Y / ZLower and upper limits used when linear motion on that axis is limited.
Linear StiffnessStiffness of the linear springs on the X, Y and Z axes.
Linear DampingDamping of the linear springs on the X, Y and Z axes.
Linear EquilibriumRest positions of the linear springs on the X, Y and Z axes.
Angular Motion X / Y / ZSelects whether angular motion on that axis is locked, limited, or free.
Angular Limits X / Y / ZLower and upper limits used when angular motion on that axis is limited.
Angular StiffnessStiffness of the angular springs about the X, Y and Z axes.
Angular DampingDamping of the angular springs about the X, Y and Z axes.
Angular EquilibriumRest angles of the angular springs about the X, Y and Z axes.

A Limits field only appears once its corresponding Motion field is set to Limited.

See Also

Scripting Interface

You can control a Joint Component's properties using a Script Component. The Joint Component's scripting interface is here.

Two behaviours are worth knowing when changing a joint from a script:

  • Setting type destroys and recreates the constraint, which also clears the broken flag. It does not pull already-separated bodies back together.
  • Setting a limit such as swingLimitY calls the constraint's limit update, so limits are live-editable while the application is running.