Is it possible to obscure 2D objects behind a transparent mesh?

Is it possible to create a transparent mesh where everything behind it or overlapping it becomes invisible? I still would like the portions of the objects which are not behind the mesh to be visible.

For context, I want to have the ability to create dynamic barriers between two different versions of the level in a 2D game which the player can then travel between. I figure that one implementation of this would be to have two cameras pointed at two different versions of the level, and when a barrier is created have the two cameras overlapping with each respective side of the barrier on each camera turned invisible. Lol does that even make sense? Is there a better way of accomplishing this effect? Thanks in advance.

Just in case anyone that was following this still needs help with it. You can achieve this effect with a custom shader on a custom material on the mesh. The custom material part is easy. Just create a custom material in your assets and attach that to your mesh. Then create a custom shader for this new material that you’ve made with the following code:

Shader "Custom/InvisibleMask"
{
    SubShader
    {
        Tags { "Queue"="Geometry-1" }
        Pass 
        {
            Blend Zero One
            Cull Off
        }
    } 
}

Now whenever a mesh with this material sits in between your camera and your scene, any portions of sprites that sit behind it won’t be visible to the camera, and the background will render to the camera instead.

Just an idea(I don’t really use 2D too often), but I believe you could use a sprite mask on the barriers. But they do the opposite by only showing things. An alternative could be to use a UI Mask. Unity has more information on the UI Mask in it’s documentation.