I know you can do render.enabled = true/false;
bur, how could I make it so it’s like .5 transparent? Do I need another engine to do that?
I know you can do render.enabled = true/false;
bur, how could I make it so it’s like .5 transparent? Do I need another engine to do that?
Nope, you need to use renderer.material, and you need to use a material that is transparent. Generic Diffuse materials are not transparent.
Here is a hint: You can make a transparent material using Shader.Find(“Transparent/Diffuse”); Then just copy over the old material’s texture color and any other settings at run time.
Note: transparent textures may sometimes cause z buffereing errors, so it is not advised to have many of them running on overlapping objects. (I am sure you are going to ask that question later when everything looks funky or is displaying back triangles that shouldn’t be there.)
You actually don’t have to copy a material’s properties when shader swapping. Materials store all of their properties and if their shader uses one of them then it “just works”. So as long as they are named the same (Diffuse and Transparent/Diffuse both have a Main Texture property for example) then you should just be able to swap the shader itself.