# GetGlobalMatrix

> Gets a global matrix property for all shaders previously set using Shader.SetGlobalMatrix.

## Definition

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

## GetGlobalMatrix(string)

Gets a global matrix property for all shaders previously set using [Shader.SetGlobalMatrix](/engine/6000.7/script-reference/unityengine/shader/setglobalmatrix.md).

```csharp
public static Matrix4x4 GetGlobalMatrix(string name)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The name of the property.

### Returns

| Type                                                                  | Description |
| --------------------------------------------------------------------- | ----------- |
| [Matrix4x4](/engine/6000.7/script-reference/unityengine/matrix4x4.md) |             |

## GetGlobalMatrix(int)

Gets a global matrix property for all shaders previously set using [Shader.SetGlobalMatrix](/engine/6000.7/script-reference/unityengine/shader/setglobalmatrix.md).

```csharp
public static Matrix4x4 GetGlobalMatrix(int nameID)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The name ID of the property retrieved by [Shader.PropertyToID](/engine/6000.7/script-reference/unityengine/shader/propertytoid.md).

### Returns

| Type                                                                  | Description |
| --------------------------------------------------------------------- | ----------- |
| [Matrix4x4](/engine/6000.7/script-reference/unityengine/matrix4x4.md) |             |
