Quantcast
Channel: Latest Questions by WJ_Fitzgerald
Viewing all articles
Browse latest Browse all 4

One Object, Multiple Materials/Shaders - Transparency/Alpha Changes

$
0
0
I'm using the below code to adjust transparency on my objects. It works great if the object has a single material/shader to deal with (Transparency/Diffuse, for example). But if my object has multiple materials/shaders, it only affects the first material/shader on the object. If you know how I can edit this script to adjust ALL the materials/shaders on a single object to be the same alpha, that would be wonderful. I appreciate your help and time with this. var slider : float; function OnGUI () { slider = GUI.HorizontalSlider( Rect(20,175,175,30), slider, 1.0, 0); renderer.material.color.a = slider; }

Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles



Latest Images