Hi everyone, I’m trying to set via script the alpha value of a SpriteRenderer. The thing is, this sprite renderer has a material that has a custom shader (which I didn’t write so I don’t know the details). I tried to change the alpha value via the Inspector but it doesn’t change anything, literally anything on the sprite. (I both tried to change the alpha value of the color of the SpriteRenderer and the alpha value of the color of the Material attached, but I got no results)
You have to know how the “Color” value of your shader is called, then in your code you can change that color using
material.SetColor(ColorName, Color);
To know how its called, you can select your material, and in the inspector you can click “Select Shader” and try to see how the color is called. There is the list of all values used in the shader plus their public name.