3d objects hide behind transparent object

Hi, i have some 3d objects in a 3d frame that have a translation animation and i want them to disappear when they exceed that frame. I tried doing that using the depth mask shader, but i’m having 2 problems: one is that i can still see the objects shadow and second is that after i apply this shader the objects don’t have the same visual quality as before(when they are not masked). Is there any other way to be doing this? I want to achieve the same effect like the one with UI masking, only that this time is with 3d objects. Thank you so much!

Create a shader that uses the stencil buffer: Using the Stencil Buffer in Unity Free | Alastair Aitchison