Format
typescript
Material.GetMatrix4x4(name)class: Material
Description
Get the value of a Matrix4x4 property from the current shader used by the material.
This method allows you to retrieve the value of a specific matrix property from the material. It is important to ensure that the property name provided is correct, otherwise it will return the default value.
Parameters
| param_name | type | description |
|---|---|---|
| name | string | The name of the property. |
Return
| type | description |
|---|---|
Matrix4x4|undefined | Whether the Matrix4x4 value is successfully retrieved.The retrieved Matrix4x4 value. |
Code Example
typescript
let material = Resources.Load<Material>(Material, "materialId");
let _Matrix = material.GetMatrix4x4("_Matrix");
Debug.Log("_Matrix : ",_Matrix)