# IConstraint

> The common interface for constraint components.

## Definition

* **Type:** Interface
* **Namespace:** [UnityEngine.Animations](/engine/6000.0/script-reference/unityengine/animations.md)
* **Assembly:** UnityEngine.AnimationModule

```csharp
public interface IConstraint
```

## Properties

| Property                                                                                                   | Description                                                |
| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
| [constraintActive](/engine/6000.0/script-reference/unityengine/animations/iconstraint/constraintactive.md) | Activate or deactivate the constraint.                     |
| [locked](/engine/6000.0/script-reference/unityengine/animations/iconstraint/locked.md)                     | Lock or unlock the offset and position at rest.            |
| [sourceCount](/engine/6000.0/script-reference/unityengine/animations/iconstraint/sourcecount.md)           | Gets the number of sources currently set on the component. |
| [weight](/engine/6000.0/script-reference/unityengine/animations/iconstraint/weight.md)                     | The weight of the constraint component.                    |

## Methods

| Method                                                                                             | Description                                |
| -------------------------------------------------------------------------------------------------- | ------------------------------------------ |
| [AddSource](/engine/6000.0/script-reference/unityengine/animations/iconstraint/addsource.md)       | Add a constraint source.                   |
| [GetSource](/engine/6000.0/script-reference/unityengine/animations/iconstraint/getsource.md)       | Gets a constraint source by index.         |
| [GetSources](/engine/6000.0/script-reference/unityengine/animations/iconstraint/getsources.md)     | Gets the list of sources.                  |
| [RemoveSource](/engine/6000.0/script-reference/unityengine/animations/iconstraint/removesource.md) | Removes a source from the component.       |
| [SetSource](/engine/6000.0/script-reference/unityengine/animations/iconstraint/setsource.md)       | Sets a source at a specified index.        |
| [SetSources](/engine/6000.0/script-reference/unityengine/animations/iconstraint/setsources.md)     | Sets the list of sources on the component. |
