# SetTexture

> Sets the value of a named texture property.

## Definition

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

## SetTexture(int, Texture)

Sets the value of a named texture property.

```csharp
public void SetTexture(int nameID, Texture t)
```

### 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.**** (\[Texture]\(/engine/6000.7/script-reference/unityengine/texture)): The new texture value.

### Remarks

Automatically changes overridden state for this property to true. If the provided texture dimension doesn't correspond to the expected dimension, this function can log an error. If that happens, this assignment is ignored.

## SetTexture(string, Texture)

Sets the value of a named texture property.

```csharp
public void SetTexture(string name, Texture t)
```

### Parameters

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

### Remarks

Automatically changes overridden state for this property to true. If the provided texture dimension doesn't correspond to the expected dimension, this function can log an error. If that happens, this assignment is ignored.
