# constraints

> Controls which degrees of freedom are allowed for the simulation of this Rigidbody2D.

## Definition

* **Type:** Property
* **Namespace:** [UnityEngine](/engine/6000.7/script-reference/unityengine.md)
* **Assembly:** UnityEngine.Physics2DModule

```csharp
public RigidbodyConstraints2D constraints { get; set; }
```

### Remarks

By default this is set to [RigidbodyConstraints2D.None](/engine/6000.7/script-reference/unityengine/rigidbodyconstraints2d/none.md), allowing rotation and movement along all axes.

In some cases, you may want to constrain a [Rigidbody2D](/engine/6000.7/script-reference/unityengine/rigidbody2d.md) to only move or rotate along some axes.  You can use the bitwise OR operator to combine multiple constraints.

Additional Resources: [RigidbodyConstraints2D](/engine/6000.7/script-reference/unityengine/rigidbodyconstraints2d.md)
