I’m trying to do an animation for a gameobject, where the gameobject is first invisible (alpha set to 0), then fade the object in with animation (alpha 0 → 1), and after a few seconds fade the object back out.
I’m using Standard → Transparent shader, which supports alpha.
For some reason the sword is visible even when alpha is set to 0. It looks like the sword itself is invisible, but has received a shadow on itself.
Receive shadows does nothing to the object when alpha is set to 0.
Cast shadows : On/Off/Two Sided all have this same effect. However, when “Shadows Only” is selected, the gameobject is actually invisible.
The transparent mode does not make the object completely “invisible” as if it didn’t even exist in the scene.
You should consider switching to “fade” mode if you want to simulate the object not even existing in the scene.
Transparent - Suitable for rendering realistic transparent materials such as clear plastic or glass. In this mode, the material itself will take on transparency values (based on the texture’s alpha channel and the alpha of the tint colour), however reflections and lighting highlights will remain visible at full clarity as is the case with real transparent materials.
Fade - Allows the transparency values to entirely fade an object out, including any specular highlights or reflections it may have. This mode is useful if you want to animate an object fading in or out. It iss not suitable for rendering realistic transparent materials such as clear plastic or glass because the reflections and highlights will also be faded out.
Interesting, but how do I select “Fade” with URP and ShaderGraph? I can only select between Transparent and Opague. Setting alpha to 0 does have the described effect (object is not invisible).
So what do I need to do in URP ShaderGraph to create a “Fade” shader?
If your in Unity URP you wont have Fade as an option but you can choose Transparent and then uncheck Presurve Specular Lighting on the material. Resulting in sumthing simular to fade. =) maby this saves sumone some time