- Home /
Best Answer
Answer by hich4m · Jul 03, 2012 at 05:49 PM
you could use :
` myObject.renderer.material.SetColor("_Color",Color(0,0,0,0.5)) ;`
btw:
.SetColor("_Color", col);
is the same as
.color = col;
The color property only sets the "_Color" color. If you have a shader where the color parameter is called differently, you have to use SetColor. For example the particle shaders don't use "_Color", they use "_TintColor".
So usually most shaders that have a color parameter call it "_Color", but it's not a must. It can be named whatever the shader programmer wants.
Your answer
Follow this Question
Related Questions
Changing the color/look of a grass textures/grass. Making it look clean. 0 Answers
Built in shaders - FX? 1 Answer
How to paint a texture transparent ? 0 Answers
Textures change to solid color in Unity 5 seemingly randomly 0 Answers
Editing Texture during Run time causing Unity Editor to Crash 1 Answer