PinJoint2D
Inherits: Joint2D < Entity2D < CanvasItem < Entity < Object
Description
Section titled “Description”A physics joint that attaches two 2D physics bodies at a single point, allowing them to freely rotate.
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
Section titled “Properties”| Type | Name | Default |
|---|---|---|
| bool | angular_limit_enabled |
false |
| float | angular_limit_lower |
0.0 |
| float | angular_limit_upper |
0.0 |
| bool | motor_enabled |
false |
| float | motor_target_velocity |
0.0 |
| float | softness |
0.0 |
Property descriptions
Section titled “Property descriptions”angular_limit_enabled
bool angular_limit_enabled = false
If true, the pin maximum and minimum rotation, defined by angular_limit_lower and angular_limit_upper are applied.
angular_limit_lower
float angular_limit_lower = 0.0
The minimum rotation. Only active if angular_limit_enabled is true.
angular_limit_upper
float angular_limit_upper = 0.0
The maximum rotation. Only active if angular_limit_enabled is true.
motor_enabled
bool motor_enabled = false
When activated, a motor turns the pin.
motor_target_velocity
float motor_target_velocity = 0.0
Target speed for the motor. In radians per second.
softness
float softness = 0.0
The higher this value, the more the bond to the pinned partner can flex.
