---
title: TryGetMatrix(int, out Matrix4x4)
product: Unity Editor
version: '7000.0'
latest_version: '7000.0'
status: This page documents version 7000.0. The latest version is 7000.0.
canonical: https://docs.unity.com/en-us/engine/7000.0/script-reference/unityengine/uielements/filterparameterwriter/trygetmatrix
latest_url: https://docs.unity.com/en-us/engine/7000.0/script-reference/unityengine/uielements/filterparameterwriter/trygetmatrix.md
last_updated: 2026-11-18
generated_at: 2026-11-24T07:19:23.271Z
locale: en-us
---

# TryGetMatrix(int, out Matrix4x4)

> Reads a matrix property that this pass has written.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.UIElements](/engine/7000.0/script-reference/unityengine/uielements.md)
* **Assembly:** UnityEngine.UIElementsModule

## TryGetMatrix(int, Matrix4x4)

```csharp
public bool TryGetMatrix(int nameID, out Matrix4x4 value)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The property ID, from [Shader.PropertyToID](/engine/7000.0/script-reference/unityengine/shader/propertytoid.md).**** (\[Matrix4x4]\(/engine/7000.0/script-reference/unityengine/matrix4x4)): The value that the shader reads, or zero when the method returns false.

### Returns

| Type                                                          | Description                                             |
| ------------------------------------------------------------- | ------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True if this pass has written the property as a matrix. |

### Remarks

Unlike [FilterParameterWriter.GetOrAddMatrixRef](/engine/7000.0/script-reference/unityengine/uielements/filterparameterwriter/getoraddmatrixref.md), this method doesn't add the property. It doesn't read the value of the material.
