# SetLayerWeight(int, float)

> Sets the weight of the layer at the given index.

## Definition

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

```csharp
public void SetLayerWeight(int layerIndex, float weight)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The layer index.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The new layer weight.
