Download

Help with only showing what is behind an object with material?

Hello!
I’m wondering if there’s a way to only be able to see what is behind a object with a material. Please excuse the title and description, I’m not 100% sure how to explain it so here’s some images.

Currently I have a procedural mesh being created that can gave any material. Here it is in pink but it will most likely not be visible in end game.
I would like that only which is being covered by the pink can be seen. This is some kind of “vision cone” I’m working on for 2D.
I’m very new to materials and post-processing in Unreal Engine so I pretty much have no idea.

What I imagine is that I can apply some “material” to certain other objects but it has 0 alpha and when this “cone” with another material passes in front of those objects, the overlapped areas are given 100 alpha, much like masking in Photoshop. Also I don’t want to hide everything like walls and such, only stuff like items and enemies that are not in the vision so if this can only be applied to specified objects, that would be great.

Thanks for your time!