Skip to content

Joint2D

Inherits: Entity2D < CanvasItem < Entity < Object

Inherited by: DampedSpringJoint2D, GrooveJoint2D, PinJoint2D

Abstract base class for all 2D physics joints.

Abstract base class for all joints in 2D physics. 2D joints bind together two physics bodies (node_a and node_b) and apply a constraint.

Type Name Default
float bias 0.0
bool disable_collision true
EntityPath node_a EntityPath("")
EntityPath node_b EntityPath("")
Returns Method
RID get_rid() const

bias

float bias = 0.0

When node_a and node_b move in different directions the bias controls how fast the joint pulls them back to their original position. The lower the bias the more the two bodies can pull on the joint.

When set to 0, the default value from ProjectSettings.physics/planar/solver/default_constraint_bias is used.

disable_collision

bool disable_collision = true

If true, the two bodies bound together do not collide with each other.

node_a

EntityPath node_a = EntityPath("")

Path to the first body (A) attached to the joint. The node must inherit PhysicsBody2D.

node_b

EntityPath node_b = EntityPath("")

Path to the second body (B) attached to the joint. The node must inherit PhysicsBody2D.

get_rid

RID get_rid() const

Returns the joint’s internal RID from the PhysicsSystem2D.