Unity: 2D translucent effect when a character is “behind” an object

In 2D games, characters (and sprites) move in an x-y plane corresponding to the screen. In order to create a sense of 3D depth, if an object A is “behind” an object B, then A is drawn on the screen before B, so B’s sprite occludes A.

However, if the object A happens to be the player’s character, then the player may not be able to see their character, or may only see a tiny bit of themselves. One method that 2D games (e.g., role-playing games) employ is to create a translucent effect. In this article, I will discuss…