I dragged said material under the var but nothing is working. No errors.
var material : Material;
var bool : boolean;
function Update () {
if(bool == true){
material.color.a = 0;
}
}
I dragged said material under the var but nothing is working. No errors.
var material : Material;
var bool : boolean;
function Update () {
if(bool == true){
material.color.a = 0;
}
}
The likely reason is that the shader does not support transparency. Try changing the shader for the material to something that you know supports transparency. Try Transparent/Diffuse. Beyond that make sure your import settings bring in a texture with an alpha channel…RGBA 32-bit for example.
Well this is my solution for that. This makes the object disappear(becomes invisible).
I haven’t test this on materials, but it could work.
Hopefully this helps you.
var object : Object;
var bool : boolean;
function Update () {
if(bool == true){
object.renderer.enabled = false
}
}