I wish to control the transparency of a model during runtime.
The model's material is connected to a shader graph. After changing the Surface Type
of the shader graph to Transparent
, an Alpha
attribute became available to control the transparency of the model (shown in the image at the bottom).
However, I do not know how to access this Alpha
attribute in the script.
I have tried OBJ.GetComponent<Renderer>().material.SetColor()
and it did not work, since Material 'MATERIAL_NAME' with Shader 'SHADER_NAME' doesn't have a color property '_Color'
.
Is there a way I can access this Alpha
attribute outside of the shader graph in a script?