Hi all.
For tests, I am using the Granade model in Unity Online Assets.
I simply need apply a fading effects in this model. I can make fade in and fade out without problems but only if in rendering mode in material I change from opaque to fade.
But the problems is that when I change to fade my model appear like transparency , but the alpha is completly opaque.
How can I fix it?
In image attached the granade model position is the same in both pics…I only change to fade mode.
Thanks
If I try with cube, sphere, mesh, same result…If I try fading with opaque the object disappears without the smooth effect…
for (float t = 0.0f; t < 2f; t += Time.deltaTime / times)
{
Color newColor = new Color(obj.GetComponent().material.color.r, obj.GetComponent().material.color.g, obj.GetComponent().material.color.b, Mathf.Lerp(alpha, value, t));
obj.GetComponent().material.color = newColor;
yield return null;
}
my code
I try to install the beta version, but the same problem…
if I use this shader all happens correctly.
Shader “Transparent/Diffuse ZWrite” {
Properties {
_Color (“Main Color”, Color) = (1,1,1,1)
_MainTex (“Base (RGB) Trans (A)”, 2D) = “white” {}
}
SubShader {
Tags {“Queue”=“Transparent” “IgnoreProjector”=“True” “RenderType”=“Transparent”}
LOD 200
// extra pass that renders to depth buffer only
Pass {
ZWrite On
ColorMask 0
}
// paste in forward rendering passes from Transparent/Diffuse
UsePass “Transparent/Diffuse/FORWARD”
}
Fallback “Transparent/VertexLit”
}
How Can I aplly it in my standard shader?
Thanks
yes, solved…thanks for all…