# SetSource(int, ConstraintSource)

> Sets a source at a specified index.

## Definition

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

```csharp
public void SetSource(int index, ConstraintSource source)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The index of the source to set.**** (\[ConstraintSource]\(/engine/6000.7/script-reference/unityengine/animations/constraintsource)): The source object and its weight.

### Remarks

Throws ArgumentOutOfRangeException, if the index is invalid.
