{% hint style="info" %}
You can access IMaterial instance through MatSystem table
{% endhint %}
{% hint style="warning" %}
In examples below all material is IMaterial instance
{% endhint %}
| Name |
Type |
Description |
| r |
float |
Red color value |
| g |
float |
Green color value |
| b |
float |
Blue color value |
material:ColorModulate(1.0, 1.0, 1.0)
| Name |
Type |
Description |
| a |
float |
Alpha color value |
material:AlphaModulate(0.5)
| Name |
Type |
Description |
| value |
string |
Name of the material |
local mat_name = material:GetName()
| Name |
Type |
Description |
| is_broken |
bool |
Is this material is error material |
local is_error = material:IsErrorMaterial()
| Name |
Type |
Description |
| flag |
int |
Flag |
| value |
bool |
Flag's value |
material:SetMaterialVarFlag(bit.blshift(1, 15), true) -- IgnoreZ