- Home /
How can I limit my players radius of vision?
I am making a top down shooter where the focus is more on stealth than shooting therefore I want to limit the amount of vision I grant to the player. I have tried using directional lighting but to no avail.
Can anyone guide me in the right direction here?
Could you describe more precisely what you want? Directional light is generally used as "sunlight".
If you are trying to do flashlight type of vision then spotlight might be the solution.
If you want certain distance around player then you could use point light.
Or simply create black overlay over player that has transparent area at the middle where you can see through.
Using light allow you to create shadows from objects like walls and create areas where you can see other than around player.
@$$anonymous$$ossuranta Would a point light allow me to create a circular area of vision around my player and everything else around it close to being black? Sorry I am a bit new to the lighting aspect of Unity. How would I implement the spot light?
And would I then put my directional light off? Thanks for the comment.
Answer by Zee-Play · Feb 22, 2017 at 01:32 PM
Point light, Soft Shadows. Make sure your point light culling mask ignores the layer where you player character is so it doesn't cast shadows, and light the character with a separate light.
Change the ambient lighting as you wish, turned it off in my case (Window-Lighting-Scene)
@Zee-Play Thanks for your comment but im not sure I understand yet. Do I give my player a point light ? Do I remove my directional light?
I want to do exactly what you've done in that image.
Yes, i removed the direct light, only have a point light in my scene. Parent the point light to your player character so it moves with him.
If this answer helped you, make sure and mark it as Correct!
Your answer
Follow this Question
Related Questions
Light through objects and missing shadow 0 Answers
Why am I getting GI Banding? 0 Answers
Bad lighting in automated builds 0 Answers
Unity 5 new Assetbundle System 0 Answers
Distance between object and shadow 0 Answers