Search Unity

Hide objects behind initial transparent object

Discussion in 'AR/VR (XR) Discussion' started by CWatsonT2, Feb 19, 2020.

  1. CWatsonT2

    CWatsonT2

    Joined:
    Jan 9, 2019
    Posts:
    114
    I'm not sure how to approach/google this. I have transparent grid walls that contain my player in the VR game. I'd like the player to only be able to see the first grid wall and not show any walls beyond that. Would this be done with a mask, shader, occlusion? What's the best approach here?
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Would that be simply making them non-transparent?
     
    dgoodman-icf likes this.
  3. CWatsonT2

    CWatsonT2

    Joined:
    Jan 9, 2019
    Posts:
    114
    If the walls are solid you feel super confined in VR. I'm building a grocery store so not being able to see the rest of the store is odd. I don't think that is the solution.
     
  4. dgoodman-icf

    dgoodman-icf

    Joined:
    Jan 7, 2019
    Posts:
    36
    Could you describe it in more detail or provide a napkin drawing or something? My reaction to your question is the same as @JoeStrout: Transparent walls with nothing behind them will show as opaque.
     
  5. CWatsonT2

    CWatsonT2

    Joined:
    Jan 9, 2019
    Posts:
    114
    Hopefully this helps. I'm using a cube with a grid texture on it. I'll be putting one of these on each aisle and deactivating them as needed. Basically I'm preventing the player from entering aisles that don't contain the items they are supposed to collect. In the example image I only want to be able to see the plane at the end of the aisle closest to the player. I want to hide the sides and rear plane of the cube that you can see when looking though it.

    I considered making the material one sided and only showing the outside of the cube but because of the layout of the store there will be cases where you will look through one cube and see other cubes behind it. It looks very cluttered when you see the grids stack up.
     

    Attached Files: