Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

How to light areas only when player can see them?

Discussion in 'Editor & General Support' started by JoKe90, Jun 10, 2015.

  1. JoKe90

    JoKe90

    Joined:
    Jun 10, 2015
    Posts:
    15
    Hello.
    I'm posting here because the Unity Ask/Answers didn't work, it gave me bad request or something.
    I'm new to Unity and programming, I have followed nearly through live training and I think that I can make simple projects to learn coding now.

    What I'd like to do now is isometric / topdown game, where player can't see through obstacles so the area behind them is black/dark. The walls/obstacles should be visible so the player doesnt have to search for opening in wall etc. Here are few example games:


    And here's my awesome paint drawing:
    idea.png

    How can I make something like this? I want to make it 3D, not 2D.
     
  2. JoKe90

    JoKe90

    Joined:
    Jun 10, 2015
    Posts:
    15
    Someone?
     
  3. Moonjump

    Moonjump

    Joined:
    Apr 15, 2010
    Posts:
    2,572
    Put a point light on the player and set the scene lighting to zero.
     
  4. JoKe90

    JoKe90

    Joined:
    Jun 10, 2015
    Posts:
    15
    That kinda works, but point light isnt evenly lighting area and shadows look weird.
    And what if I want player to know that there are those "cubes" even when area is dark ?
    test.png
     
  5. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,629
    I'm not quite sure what you mean, but maybe you'd want two or three lights on the player, say one offset a little from the left of center and one a little from the right?
     
  6. JoKe90

    JoKe90

    Joined:
    Jun 10, 2015
    Posts:
    15
    I want to make exploring areas similar to that video TK (Tapan Kaikki) 4 Bloodshed.