# GetSource(int)

> Gets a constraint source by index.

## Definition

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

```csharp
public ConstraintSource GetSource(int index)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The index of the source.

### Returns

| Type                                                                                           | Description                       |
| ---------------------------------------------------------------------------------------------- | --------------------------------- |
| [ConstraintSource](/engine/6000.6/script-reference/unityengine/animations/constraintsource.md) | The source object and its weight. |

### Remarks

Throws InvalidOperationException, if the list of sources is empty. Throws ArgumentOutOfRangeException, if the index is invalid.
