- Home /
How do you access alpha on a mobile Alpha Blended shader?
Hi there,
I'm making a mobile game, and I need to change the opacity of a material. The material is Mobile/Particles/Alpha blended.
Color c = SettingsSymbol.GetComponent<Renderer>().material.GetColor("_TintColor");
Does not work, as well as other generic options. Is it even possible to change the color with the material? Is there another one that could do the trick for mobile? If not, how could I make such a shader?
Any help is greatly appreciated :D
Luke
Answer by popupAsylum · Jun 30, 2015 at 07:09 PM
You need to use SetColor
Color c = material.GetColor("_TintColor");
c.a = myAlphaValue;
material.SetColor("_TintColor", c);
That wasn't really the issue, the issue was that alpha blended shaders don't seem to have a color property. Should've formulated my question better^^
Your answer
Follow this Question
Related Questions
Unwanted rendering on top of all objects!? 0 Answers
Control materials opacity. 2 Answers
need help making this mobile shader more efficient 0 Answers
Mobile\Vertex Colored shader 0 Answers