Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by youdaya · May 08, 2016 at 05:56 PM · shaderraycastocclusion cullinglinecast

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. alt text

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.

screen-shot-2016-05-08-at-180321.png (149.2 kB)
Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image gaberutd · Dec 13, 2016 at 05:15 PM 0
Share

@Youdaya, could you post the stencil shader you used?

1 Reply

· Add your reply
  • Sort: 
avatar image
2

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/

Comment
Add comment · Show 6 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image youdaya · May 09, 2016 at 09:09 PM 0
Share

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.

avatar image youdaya · May 09, 2016 at 09:47 PM 0
Share

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.

avatar image youdaya · May 11, 2016 at 06:17 AM 0
Share

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..

alt text

exp.jpg (368.7 kB)
avatar image tanoshimi youdaya · May 11, 2016 at 06:21 AM 0
Share

You need to reverse your test condition then from Equal to NotEqual: http://docs.unity3d.com/$$anonymous$$anual/SL-Stencil.html

avatar image christoph-goettert · Mar 08, 2017 at 10:01 AM 0
Share

I ran into the same issue, did you solve this problem somehow so that only objects INFRONT of the other are able to obscure?

avatar image christoph-goettert christoph-goettert · Mar 08, 2017 at 12:11 PM 1
Share

In case anyone else encounters the same issue, this post was the solution for me.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Physics.Linecast seems to do opposite of what it says? 1 Answer

Problem with LineCast Bullet 1 Answer

Linecast, rotate end point relative to objects rotation 1 Answer

issues with jumping and linecast2d and raycast2d 0 Answers

Pointcast? - Raycast Point X from same Point X 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges