How to make the material of an actor transparent when player is behind it?

Hi guys & gals!

I am making a small prototype with a Diabloish point of view, but struggle with my basic camera and material setup. I want the player to be visible at all times, even though he is behind walls, so therefore I need the material opacity of the occluding actors to be affected when theyre between the player and the camera. ( see below ) I had a look at using postprocess materials, but my brain just couldnt figure out a proper way to solve the problem. I also did some tests using linetracing from the camera towards the player and detecting the hit objects, but Im pretty sure that`s not an optimal solution.

I would really appreciate if anyone could give me a pointer or two in the right direction! :slight_smile:

Cheers,

Roald

This is the effect I am trying to achieve.

Do a raycast between the camera and the player, if the ray hits an object, that isn’t the player, so set it’s opacity through a dynamic material instance.