Skip to main content

Overview

Joints connect two physics bodies together or constrain a single body relative to a point in space. Godot provides various joint types for different mechanical behaviors.

Joint basics

All joints share common properties:
Joints bind two physics bodies together. At least one of the bodies must be dynamic (RigidBody) for the joint to have any effect.

2D joints

PinJoint2D

Connects two bodies at a single point, allowing rotation.
Use cases:
  • Pendulums
  • Ragdoll joints
  • Chains and ropes

GrooveJoint2D

Constrains one body to move along a groove (line) relative to another.
Use cases:
  • Sliding doors
  • Elevator platforms
  • Linear motion constraints

DampedSpringJoint2D

A spring joint with damping, creating elastic connections.
Use cases:
  • Suspension systems
  • Elastic ropes
  • Springy platforms
  • Soft body simulation
Increase damping to reduce oscillation. Higher stiffness creates a stiffer spring.

3D joints

PinJoint3D

Connects two bodies at a point with configurable constraints.

HingeJoint3D

A rotating hinge joint around a single axis.
Use cases:
  • Doors
  • Wheels
  • Levers
  • Mechanical arms
  • PARAM_BIAS: Constraint correction speed
  • PARAM_LIMIT_UPPER: Maximum angle
  • PARAM_LIMIT_LOWER: Minimum angle
  • PARAM_LIMIT_BIAS: Limit correction speed
  • PARAM_LIMIT_SOFTNESS: Limit softness
  • PARAM_LIMIT_RELAXATION: Limit relaxation
  • PARAM_MOTOR_TARGET_VELOCITY: Motor speed
  • PARAM_MOTOR_MAX_IMPULSE: Motor strength

SliderJoint3D

Allows linear and angular motion along one axis.
Use cases:
  • Sliding doors
  • Drawer mechanics
  • Telescoping mechanisms
  • Piston motion

ConeTwistJoint3D

A ball-and-socket joint with cone angle limits.
Use cases:
  • Ragdoll shoulders
  • Ball joints
  • Gimbal systems
  • Character limbs

Generic6DOFJoint3D

A highly configurable joint with 6 degrees of freedom (3 linear, 3 angular).
Use cases:
  • Complex mechanical systems
  • Custom constraints
  • Advanced ragdoll joints
  • Robotic joints
Generic6DOFJoint3D is the most flexible but also the most complex joint. Use simpler joints when possible for better performance.

Joint configuration

Bias parameter

Controls how quickly the joint corrects constraint violations:

Disable collision

Prevent connected bodies from colliding:

Breaking joints

Joints can’t be broken by default. Implement custom breaking:

Common patterns

Chain simulation

Suspension system

Ragdoll creation

Debugging joints

Visualize joints in the editor:
  1. Select the joint node
  2. The joint will be displayed with debug gizmos
  3. Adjust the position to align bodies correctly

Performance considerations

Minimize joint count

Each joint adds computational cost. Use the minimum number needed.

Use appropriate joint types

Simpler joints (pin, hinge) are faster than complex ones (Generic6DOF).

Adjust solver iterations

Increase solver iterations in project settings for more stable joints at the cost of performance.

Put jointed bodies to sleep

Connected bodies automatically sleep when stationary, improving performance.

Next steps

Physics introduction

Learn about physics fundamentals

Collision shapes

Understand collision shape types