Make wall partially transparent when player is behind it

Hi guys, I’m trying to create a specific shader for my game. It’s an isometric game, and any time the player is obscured behind a wall I want to be able to “cut out” a circle in the geometry around him so that he can be seen at all times. A perfect example can be seen in this video from Fallout 1, at exactly 8:36;

I particularly like how the circle has soft edges and really want to emulate that specifically.

Now I’ve actually made some decent progress with this, but I’m still not an expert with shaders so I defo still need some advice on getting it properly implemented. Thanks to other forum posts and tutorials I’ve experimented with the “depth mask” here; ( http://wiki.unity3d.com/index.php?title=DepthMask ) and managed to “cut out” a solid circle in my walls which exposes my character, by simply placing a “mask” object in front of him at all times. However it cuts out ALL walls including those deeper into the scene behind him, not just the front most, and it also doesn’t have the smooth edges I’m looking for either. Has potential, but I put it on old.

I then found an old thread on these forums ( http://forum.unity3d.com/threads/35808-Projecting-a-hole ) about someone using a projector to “paint” transparency over objects as needed, with the projector essentially cutting through anything it shines on. This looks really nice, works well, and with the right shaped round alpha, even has nice soft edges. The down side is that the example(s) in the thread only work on very, very simple materials. As in, solid coloured objects and nothing more. I need fully materialed objects with their own textures, lighting, possibly even normals, etc, that I can still project a hole whenever needed.

Would really appreciate any tips or advice, or even solutions if you guys have any. I know it’s quite a tall order, but it would really make my game shine. I could possibly provide a (very) small payment if anyone’s willing to write the whole thing from scratch if it looks as good as in Fallout.

Hello Diggler, you should create two materials. Here is the code:

var transparentMaterial : Material;
private var myMaterial : Material;

function Awake()
{
    myMaterial = gameObject.renderer.material;
}

function Update()
{
    if(<here is the code to check if he is behind the wall>)
    {
        gameObject.renderer.material = transparentMaterial;
    }
    else
    {
        gameObject.renderer.material = myMaterial;
    }
}

Tell me if it works, and tell me if it doesn’t!

Ivan Božović

http://steamcommunity.com/sharedfiles/filedetails/?id=240845770
check this out
this unity game has fallout style wall holes

You can use See-Through System to achieve that. It’s shader-independent, so you don’t need to change your materials.
It’s avaliable on asset store:

hey know this is an old post but im stuck on this also and cant really work out what exactly I need to be doing to achieve desiered effects