- Home /
Question by
uncorporollie · May 22, 2017 at 03:13 PM ·
c#shadersmaterialsalpha
Controlling overall alpha of a material with texture-mapped alpha
I need to control the overall opacity of a game object that has a material which uses the unlit/transparent shader and a texture map to define varying alpha across its surface.
In other words, my object is partially transparent to begin with, but I want to be able to fade it in and out using code.
If it was a uniform color/opacity to begin with, then I could use GetComponent<Renderer>().material.SetColor()
, but since it isn't, I'm stuck.
Please help.
Comment
Your answer
Follow this Question
Related Questions
Instanced material ignoring value changes. 2 Answers
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Changing HDRP Material's Texture At Runtime Not Working? 2 Answers
Blend 2 linerender colors at point of interception 0 Answers