# PhysicsDistanceJointDefinition

> A joint definition used to specify properties when creating a PhysicsDistanceJoint.

## Definition

* **Type:** Struct
* **Namespace:** [Unity.U2D.Physics](/engine/6000.5/script-reference/unity/u2d/physics.md)
* **Assembly:** UnityEngine.PhysicsCore2DModule

```csharp
public struct PhysicsDistanceJointDefinition
```

## Constructors

| Constructor                                                                                                                                                                       | Description                                                                                                                    |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| [PhysicsDistanceJointDefinition()](/engine/6000.5/script-reference/unity/u2d/physics/physicsdistancejointdefinition/ctor.md#physicsdistancejointdefinition\(\))                   | Create a default [PhysicsDistanceJoint](/engine/6000.5/script-reference/unity/u2d/physics/physicsdistancejoint.md) definition. |
| [PhysicsDistanceJointDefinition(System.Boolean)](/engine/6000.5/script-reference/unity/u2d/physics/physicsdistancejointdefinition/ctor.md#physicsdistancejointdefinition\(bool\)) | Create a default [PhysicsDistanceJoint](/engine/6000.5/script-reference/unity/u2d/physics/physicsdistancejoint.md) definition. |

## Properties

| Property                                                                                                                 | Description                                                                                                                                     |
| ------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| [bodyA](/engine/6000.5/script-reference/unity/u2d/physics/physicsdistancejointdefinition/bodya.md)                       | The first body the joint constrains.                                                                                                            |
| [bodyB](/engine/6000.5/script-reference/unity/u2d/physics/physicsdistancejointdefinition/bodyb.md)                       | The second body the joint constrains.                                                                                                           |
| [collideConnected](/engine/6000.5/script-reference/unity/u2d/physics/physicsdistancejointdefinition/collideconnected.md) | Whether the shapes on the pair of bodies can come into contact.                                                                                 |
| [distance](/engine/6000.5/script-reference/unity/u2d/physics/physicsdistancejointdefinition/distance.md)                 | The desired distance constraint i.e. the rest length of this joint. This has a lower stable limit of just above zero.                           |
| [drawScale](/engine/6000.5/script-reference/unity/u2d/physics/physicsdistancejointdefinition/drawscale.md)               | Controls the scaling of the joint drawing. Not all joints have scalable elements but those that do will use this scaling.                       |
| [enableLimit](/engine/6000.5/script-reference/unity/u2d/physics/physicsdistancejointdefinition/enablelimit.md)           | Enable/disable the joint limit.                                                                                                                 |
| [enableMotor](/engine/6000.5/script-reference/unity/u2d/physics/physicsdistancejointdefinition/enablemotor.md)           | Enable/Disable the joint motor.                                                                                                                 |
| [enableSpring](/engine/6000.5/script-reference/unity/u2d/physics/physicsdistancejointdefinition/enablespring.md)         | Enable/Disable the distance constraint to behave like a spring. If false then the distance joint will be rigid, overriding the limit and motor. |
| [forceThreshold](/engine/6000.5/script-reference/unity/u2d/physics/physicsdistancejointdefinition/forcethreshold.md)     | The force threshold beyond which a joint event will be produced.                                                                                |
| [localAnchorA](/engine/6000.5/script-reference/unity/u2d/physics/physicsdistancejointdefinition/localanchora.md)         | The local anchor frame constraint relative to bodyA's origin.                                                                                   |
| [localAnchorB](/engine/6000.5/script-reference/unity/u2d/physics/physicsdistancejointdefinition/localanchorb.md)         | The local anchor frame constraint relative to bodyB's origin.                                                                                   |
| [maxDistanceLimit](/engine/6000.5/script-reference/unity/u2d/physics/physicsdistancejointdefinition/maxdistancelimit.md) | Maximum length limit of this joint. Must be greater than or equal to the minimum length.                                                        |
| [maxMotorForce](/engine/6000.5/script-reference/unity/u2d/physics/physicsdistancejointdefinition/maxmotorforce.md)       | The maximum force the motor can apply, usually in newtons.                                                                                      |
| [minDistanceLimit](/engine/6000.5/script-reference/unity/u2d/physics/physicsdistancejointdefinition/mindistancelimit.md) | Minimum length limit of this joint. This will be clamped to a lower stable limit.                                                               |
| [motorSpeed](/engine/6000.5/script-reference/unity/u2d/physics/physicsdistancejointdefinition/motorspeed.md)             | The desired motor speed, usually in meters per second.                                                                                          |
| [springDamping](/engine/6000.5/script-reference/unity/u2d/physics/physicsdistancejointdefinition/springdamping.md)       | The spring linear damping, non-dimensional. Use 1 for critical damping.                                                                         |
| [springFrequency](/engine/6000.5/script-reference/unity/u2d/physics/physicsdistancejointdefinition/springfrequency.md)   | The spring linear stiffness frequency, in cycles per second.                                                                                    |
| [springLowerForce](/engine/6000.5/script-reference/unity/u2d/physics/physicsdistancejointdefinition/springlowerforce.md) | The lower spring force controls how much tension the spring can sustain.                                                                        |
| [springUpperForce](/engine/6000.5/script-reference/unity/u2d/physics/physicsdistancejointdefinition/springupperforce.md) | The upper spring force controls how much compression the spring can sustain.                                                                    |
| [torqueThreshold](/engine/6000.5/script-reference/unity/u2d/physics/physicsdistancejointdefinition/torquethreshold.md)   | The torque threshold beyond which a joint event will be produced.                                                                               |
| [tuningDamping](/engine/6000.5/script-reference/unity/u2d/physics/physicsdistancejointdefinition/tuningdamping.md)       | Controls the joint stiffness damping, non-dimensional. Use 1 for critical damping.                                                              |
| [tuningFrequency](/engine/6000.5/script-reference/unity/u2d/physics/physicsdistancejointdefinition/tuningfrequency.md)   | Controls the joint stiffness frequency, in cycles per second.                                                                                   |
| [worldDrawing](/engine/6000.5/script-reference/unity/u2d/physics/physicsdistancejointdefinition/worlddrawing.md)         | Controls whether this joint is automatically drawn when the world is drawn.                                                                     |

## Static Properties

| Property                                                                                                                   | Description                                                                                                                 |
| -------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| [defaultDefinition](/engine/6000.5/script-reference/unity/u2d/physics/physicsdistancejointdefinition/defaultdefinition.md) | Get a default [PhysicsDistanceJoint](/engine/6000.5/script-reference/unity/u2d/physics/physicsdistancejoint.md) definition. |
