# SetPropertyBlock

> Lets you set or clear per-renderer or per-material parameter overrides.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.5/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

## SetPropertyBlock(MaterialPropertyBlock)

Lets you set or clear per-renderer or per-material parameter overrides.

```csharp
public void SetPropertyBlock(MaterialPropertyBlock properties)
```

### Parameters

**** (\[MaterialPropertyBlock]\(/engine/6000.5/script-reference/unityengine/materialpropertyblock)): Property block with values you want to override.

### Remarks

This is recommended when only a few properties of a Material are different per object. This is more memory efficient than having one complete distinct Material per object.

You can also provide a Material index (from 0 to Renderer.materials.Length-1). In this case, only parameters of that Material are set. If there is both a per-renderer and a per-material block, only the per-Material block is used.

To disable any of per-Renderer or per-Material overrides, pass null as the property’s argument.

Additional Resources: [MaterialPropertyBlock](/engine/6000.5/script-reference/unityengine/materialpropertyblock.md), [Renderer.GetPropertyBlock](/engine/6000.5/script-reference/unityengine/renderer/getpropertyblock.md).

## SetPropertyBlock(MaterialPropertyBlock, int)

Lets you set or clear per-renderer or per-material parameter overrides.

```csharp
public void SetPropertyBlock(MaterialPropertyBlock properties, int materialIndex)
```

### Parameters

**** (\[MaterialPropertyBlock]\(/engine/6000.5/script-reference/unityengine/materialpropertyblock)): Property block with values you want to override.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The index of the Material you want to override the parameters of. The index ranges from 0 to Renderer.sharedMaterials.Length-1.

### Remarks

This is recommended when only a few properties of a Material are different per object. This is more memory efficient than having one complete distinct Material per object.

You can also provide a Material index (from 0 to Renderer.materials.Length-1). In this case, only parameters of that Material are set. If there is both a per-renderer and a per-material block, only the per-Material block is used.

To disable any of per-Renderer or per-Material overrides, pass null as the property’s argument.

Additional Resources: [MaterialPropertyBlock](/engine/6000.5/script-reference/unityengine/materialpropertyblock.md), [Renderer.GetPropertyBlock](/engine/6000.5/script-reference/unityengine/renderer/getpropertyblock.md).
