Table of Contents

Class PinJoint2D

A physics joint that attaches two 2D physics bodies at a single point, allowing them to freely rotate.

Inheritance
PinJoint2D

Remarks

A physics joint that attaches two 2D physics bodies at a single point, allowing them to freely rotate. For example, a RigidBody2D can be attached to a StaticBody2D to create a pendulum or a seesaw.

Properties

angular_limit_enabled

If true, the pin maximum and minimum rotation, defined by angular_limit_lower and angular_limit_upper are applied.

var angular_limit_enabled : bool = false

Property Value

bool

Remarks

  • void set_angular_limit_enabled(bool value)
  • bool is_angular_limit_enabled

angular_limit_lower

The minimum rotation. Only active if angular_limit_enabled is true.

var angular_limit_lower : float = 0.0

Property Value

float

Remarks

  • void set_angular_limit_lower(float value)
  • float get_angular_limit_lower

angular_limit_upper

The maximum rotation. Only active if angular_limit_enabled is true.

var angular_limit_upper : float = 0.0

Property Value

float

Remarks

  • void set_angular_limit_upper(float value)
  • float get_angular_limit_upper

motor_enabled

When activated, a motor turns the pin.

var motor_enabled : bool = false

Property Value

bool

Remarks

  • void set_motor_enabled(bool value)
  • bool is_motor_enabled

motor_target_velocity

Target speed for the motor. In radians per second.

var motor_target_velocity : float = 0.0

Property Value

float

Remarks

  • void set_motor_target_velocity(float value)
  • float get_motor_target_velocity

softness

The higher this value, the more the bond to the pinned partner can flex.

var softness : float = 0.0

Property Value

float

Remarks

  • void set_softness(float value)
  • float get_softness