Search Unity

Question Want light to be blocked

Discussion in '2D' started by CodeMateo, Jun 19, 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.