# SetMatrixArray

> Sets a matrix array uniform.

## Definition

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

## SetMatrixArray(int, Matrix4x4\[])

Sets a matrix array uniform.

```csharp
public void SetMatrixArray(int nameID, Matrix4x4[] values)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The ID of the property as given by Shader.PropertyToID.**** (\[Matrix4x4\[]]\(/engine/6000.6/script-reference/unityengine/matrix4x4)): The matrix array to set.

### Remarks

Only shaders defined in the .raytrace file can access the matrix array you designate as the argument for this method. To make this matrix array accessible to all ray tracing shader types (closest hit, any hit, miss, etc.), call the [Shader.SetGlobalMatrixArray](/engine/6000.6/script-reference/unityengine/shader/setglobalmatrixarray.md) method instead.

## SetMatrixArray(string, Matrix4x4\[])

Sets a matrix array uniform.

```csharp
public void SetMatrixArray(string name, Matrix4x4[] values)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The name of the property being set.**** (\[Matrix4x4\[]]\(/engine/6000.6/script-reference/unityengine/matrix4x4)): The matrix array to set.

### Remarks

Only shaders defined in the .raytrace file can access the matrix array you designate as the argument for this method. To make this matrix array accessible to all ray tracing shader types (closest hit, any hit, miss, etc.), call the [Shader.SetGlobalMatrixArray](/engine/6000.6/script-reference/unityengine/shader/setglobalmatrixarray.md) method instead.
