A feature of many games is for objects to fade away to invisible, or appear gradually from invisible to fully visible. Unity provides the special Rendering Mode of Fade for exactly this purpose.
In this recipe, we will create an object that, once clicked, fades out and disappears. We'll also look at how to enahnce the code, to take account of the GameObject's own initial alpha value, to self-destruct when fading has finished and so on.