[Question] [SOLVED] Material that hides only the player that's on the other side

Hey devs!

As I wasn’t able to find any decent answer I need an advice from one of you - materials masters :space_invader:

I am working on a cool VR project with Hi-Tech tools and one of them is supposed to be a shield, but not just shield! Depending on some circumstances it can become to be either blocking or reflecting shield or a hiding shield to hide the Player behind it.

This should work as a cover f.ex. if you are trying to flee from an enemy Player you can use that shield and it will make the Actor (and it’s all children) invisible (fully or partially, doesn’t matter) for the players that stand on the other side but the environment should not be affected by this effect

There are plenty tutorials for a Highlighted object with the X-ray effect but what I need is kinda reverse and I really couldn’t find my answer

How would you go about such Material or maybe you know a nice source where it already exists?

Thanks in advance mates and wish you an amazing day! :sunglasses:


Its not easy. The only way i can think of is use customdepth, if something is overwriting the player in customdepth, hide the pixel, in a masked material.

1 Like

At least some point here, will give it a shot with docs

If the player mesh is assigned a translucent material, it should render the player 100% invisible without affecting the background at all (or needing to resort to custom depth tricks). The challenge is how-to solve the shield only partially occluding the mesh with protruding limbs that aren’t to be affected by the transparency. Not sure about that. VFX gods / Modular-Character gurus could help maybe if they’re around. @Luos @TechLord

I do better with visual examples. But, you could use two materials, swapping between the two when needed.

Hey again

Actually as I call myself Unreal Solver - I found my own solution to this!

I will not tell you what is it yet, I’ll make it ready and share a short video ;]

Just a tip - it’s not material based! (directly)

1 Like

Okay, so I started to work on it but it’s hard to implement it as you wish if you lack Materials knowledge :laughing:

My idea - use the Scene Capture 2D component and put its sight as Material on the shield so it will show everything besides what I wanna hide with the array and so I can hide my player :sunglasses:


As the shield isn’t flat the texture looks weirdly bended, tried to play with UV’s in Material, re-UV-ing the model from another software, changing Texture size but I still cannot manage to get a decent representation of what is behind the shield

But still it’s not sooo bad as I make the character fully invisible through that material the shield will at least be somewhat visible because it would be unfair if we were fully invisible and the enemy cannot see us at all, right?

Btw - it’s nice from you @AntiGravity that you brought us some advanced Users to help and @TechLord for liking the idea - here’s what I’ve got so far and I’ll update this post with a lil video representation ;]

2021-07-31 16_48_44-Window
2021-07-31 16_47_23-Window
2021-07-31 16_46_13-Window

Here’s an in-game picture!

It’s hard to get well hidden but it works! As you can see it hides all parts of my body :space_invader:
And just so you know what’s happening - there’s a mirror in front of me and the red parts on the bottom is the helmet I wear and it’s a VR game

And now I have a new challenge - Create separate textures and materials for every existing shield, wish me luck :rofl:

Thanks again to everyone!

1 Like

Did I promised that I’ll upload a video?

Watch the video below or head towards this thread

It doesn’t contain the shield tho as there’s no usage as long as I play alone XD and also it needs some rework anyway so I didn’t used it for that video

1 Like