Search Unity

Question How to make invisible roof that casts shadow.

Discussion in 'General Graphics' started by ImagineTheEnding, Aug 2, 2022.

  1. ImagineTheEnding

    ImagineTheEnding

    Joined:
    Jun 9, 2015
    Posts:
    5
    So I am making a game that looks like this (it's a prototype right now).



    I would like to make it to where there is an invisible roof so you don't see the wall's shadow. How do I do that?

    -The sun rotates over time because there is a day-night cycle.
    -I tried having the camera's culling mask ignore the roof, but that didn't work.
     
  2. c0d3_m0nk3y

    c0d3_m0nk3y

    Joined:
    Oct 21, 2021
    Posts:
    670
    There are probably many ways to do it.

    The first thing that comes to mind is: Create a plane for the ceiling where the normal points downwards. You should be able to see through it from above due to regular backface culling. Then turn on two-sided shadows for the plane.
     
  3. Antilight

    Antilight

    Joined:
    Oct 19, 2018
    Posts:
    7
    • Create a plane.
    • Go into the Mesh Renderer component.
    • Click the dropdown for shadows and select "shadows only."
    The fact that nobody told you about this property in 8 days proves these forums are dead and useless.
     
    c0d3_m0nk3y likes this.
  4. c0d3_m0nk3y

    c0d3_m0nk3y

    Joined:
    Oct 21, 2021
    Posts:
    670
    Haha, I even linked the page and didn't see the option.