PinJoint2D
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.
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.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
PinJoint2DConstructor
public PinJoint2D();Properties6
AngularLimitEnabledProperty
public bool AngularLimitEnabled { get; set; }If true, the pin maximum and minimum rotation, defined by PinJoint2D.AngularLimitLower and PinJoint2D.AngularLimitUpper are applied.
AngularLimitLowerProperty
public float AngularLimitLower { get; set; }The minimum rotation. Only active if PinJoint2D.AngularLimitEnabled is true.
AngularLimitUpperProperty
public float AngularLimitUpper { get; set; }The maximum rotation. Only active if PinJoint2D.AngularLimitEnabled is true.
MotorEnabledProperty
public bool MotorEnabled { get; set; }When activated, a motor turns the pin.
MotorTargetVelocityProperty
public float MotorTargetVelocity { get; set; }Target speed for the motor. In radians per second.
SoftnessProperty
public float Softness { get; set; }The higher this value, the more the bond to the pinned partner can flex.
Methods12
GetAngularLimitLowerfloat
public float GetAngularLimitLower();floatGetAngularLimitUpperfloat
public float GetAngularLimitUpper();floatGetMotorTargetVelocityfloat
public float GetMotorTargetVelocity();floatGetSoftnessfloat
public float GetSoftness();floatIsAngularLimitEnabledbool
public bool IsAngularLimitEnabled();boolIsMotorEnabledbool
public bool IsMotorEnabled();boolSetAngularLimitEnabledvoid
public void SetAngularLimitEnabled(bool enabled);| Name | Type | Default |
|---|---|---|
enabled | bool | — |
SetAngularLimitLowervoid
public void SetAngularLimitLower(float angularLimitLower);| Name | Type | Default |
|---|---|---|
angularLimitLower | float | — |
SetAngularLimitUppervoid
public void SetAngularLimitUpper(float angularLimitUpper);| Name | Type | Default |
|---|---|---|
angularLimitUpper | float | — |
SetMotorEnabledvoid
public void SetMotorEnabled(bool enabled);| Name | Type | Default |
|---|---|---|
enabled | bool | — |
SetMotorTargetVelocityvoid
public void SetMotorTargetVelocity(float motorTargetVelocity);| Name | Type | Default |
|---|---|---|
motorTargetVelocity | float | — |
SetSoftnessvoid
public void SetSoftness(float softness);| Name | Type | Default |
|---|---|---|
softness | float | — |