Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Lights blocked by light

Discussion in 'General Graphics' started by CodeMateo, Jun 7, 2020.

  1. CodeMateo

    CodeMateo

    Joined:
    May 21, 2020
    Posts:
    77
    Hey guys, I'm new to unity and I'm trying to create a 2D game. My game consists of a randomly generated dungeon, that is completely black except for your torch that you hold in your game. A problem I'm having is trying to get the light to not go through the walls. I wanted to know if it is possible if I could add a script to my light that wouldn't allow my light to go through the wall whenever there is a box collider of some sort (as to create realism). Thank you to anyone who replies.
     
  2. BrandyStarbrite

    BrandyStarbrite

    Joined:
    Aug 4, 2013
    Posts:
    2,076
    If you're using 3d models to make a 2d style game, try making the walls thicker. Normally, that would solve that problem.
     
  3. CodeMateo

    CodeMateo

    Joined:
    May 21, 2020
    Posts:
    77
    That's too funny lol. I found out about shadow casters 2D, and I also implemented a better art style that added thicker walls. But thanks anyways man