A feature of many games is for objects to fade away so that they're invisible, or so that they appear gradually until they're fully visible. Unity provides a special Rendering Mode called Fade for this purpose.
In this recipe, we will create an object that, once clicked, fades out and disappears. We'll also look at how to enhance the code so that it takes the GameObject's own initial alpha value into account. This will make it self-destruct and destroy the GameObject completely when the object has faded out.