Joint2D
Abstract base class for all 2D physics joints.
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.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Properties4
BiasProperty
public float Bias { get; set; }When node_a and node_b move in different directions the Joint2D.Bias controls how fast the joint pulls them back to their original position. The lower the Joint2D.Bias the more the two bodies can pull on the joint.
When set to 0, the default value from ProjectSettings.physics/2d/solver/default_constraint_bias is used.
DisableCollisionProperty
public bool DisableCollision { get; set; }If true, the two bodies bound together do not collide with each other.
EntityAProperty
public EntityPath EntityA { get; set; }Path to the first body (A) attached to the joint. The node must inherit PhysicsBody2D.
EntityBProperty
public EntityPath EntityB { get; set; }Path to the second body (B) attached to the joint. The node must inherit PhysicsBody2D.
Methods9
GetBiasfloat
public float GetBias();floatGetEntityAEntityPath
public EntityPath GetEntityA();EntityPathGetEntityBEntityPath
public EntityPath GetEntityB();EntityPathGetExcludeEntitiesFromCollisionbool
public bool GetExcludeEntitiesFromCollision();boolGetRidRid
public Rid GetRid();Returns the joint's internal Rid from the PhysicsServer2D.
RidSetBiasvoid
public void SetBias(float bias);| Name | Type | Default |
|---|---|---|
bias | float | — |
SetEntityAvoid
public void SetEntityA(EntityPath node);| Name | Type | Default |
|---|---|---|
node | EntityPath | — |
SetEntityBvoid
public void SetEntityB(EntityPath node);| Name | Type | Default |
|---|---|---|
node | EntityPath | — |
SetExcludeEntitiesFromCollisionvoid
public void SetExcludeEntitiesFromCollision(bool enable);| Name | Type | Default |
|---|---|---|
enable | bool | — |