# SetGradient

> Sets the value of a named Gradient property.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.VFX](/engine/6000.7/script-reference/unityengine/vfx.md)
* **Assembly:** UnityEngine.VFXModule

## SetGradient(int, Gradient)

Sets the value of a named Gradient property.

```csharp
public void SetGradient(int nameID, Gradient g)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The ID of the property. This is the same ID that [Shader.PropertyToID](/engine/6000.7/script-reference/unityengine/shader/propertytoid.md) returns.**** (\[Gradient]\(/engine/6000.7/script-reference/unityengine/gradient)): The new Gradient value.

### Remarks

Automatically changes overridden state for this property to true.

## SetGradient(string, Gradient)

Sets the value of a named Gradient property.

```csharp
public void SetGradient(string name, Gradient g)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The name of the property.**** (\[Gradient]\(/engine/6000.7/script-reference/unityengine/gradient)): The new Gradient value.

### Remarks

Automatically changes overridden state for this property to true.
