- Home /
hiding objects/part of objects behind a invisible wall
Hi all, I am trying to create an invisible wall that would hide objects/part of objects as per shown in image below.
I am very new to unity and i need this for my coursework.
I tried to look onto Sharder, linecast, raycast and occlusion. I couldn't get this right at all.
Please anyone could help me.
Answer by tanoshimi · May 08, 2016 at 06:01 PM
What you're looking for is a stencil mask, like https://alastaira.wordpress.com/2014/12/27/using-the-stencil-buffer-in-unity-free/
Thank you Tanoshimi, I went through the link and mimicked exactly as the guide. It works well but it is totally opposite of what i want. I want to build a wall that will hide objects. The example you sent is for a invisible window that will allow to see objects. I hope you understand what i mean.
Any other suggestion? Appreciate your help.
Thank you @Tanoshimi for guiding to use stencil. I found a perfect example in youtube
https://www.youtube.com/watch?v=l7LQmJuoiBY
This solved the issue. Thanks to PushyPixels too for wonderful tutor in youtube.
hi all,
It is still not 100% what I really needed to be.
Using Sentcil mask, hides the objects even if they falls behind or in front of a invisible wall. see images below. I want to hide the objects only if they are behind the invisible wall.
Is it possible? I really appreciate any help and guide..
You need to reverse your test condition then from Equal to NotEqual: http://docs.unity3d.com/$$anonymous$$anual/SL-Stencil.html
I ran into the same issue, did you solve this problem somehow so that only objects INFRONT of the other are able to obscure?
In case anyone else encounters the same issue, this post was the solution for me.