(Semi) Transparency and 3rd person camera

Hey all! I’m still very new to Unity, so please bear with me.

I’m trying to create a third person camera that makes objects semi-transparent (or invisible if semi-transparent isn’t possible) when they interrupt the line of sight between camera and player. I’m using the SmoothFollow script for the camera atm.

I know I’m going to have to use ray casting for the line of sight, but I have no idea what I’m doing when it comes to shaders.

Any ideas or resources I should look at?

This is relevant to my interests as well friend!

I’d PM forestjohnson about this-he knows a lot about shaders.

Once you have an object returned from the raycast, it’s quite simple via scripting to change it’s material or shader to a transparent one. So your raycast hits a wall between you and the camera. You switch the object’s shader to transparent/diffuse and color to 50% alpha. Instant translucent wall.

Here’s the general documentation you want to look at.

Specifically this section.

Just remember to cache the original setup and change it back when you’re done!