In my 3D game, I need a system to determine whether the player is standing in complete darkness (returning false) or under a streetlight or any other light source (returning true).
The following options are not suitable as they require too many resources:
Raycasting in a circle and searching for objects with the Light component.
Caching all light sources and checking the distance.
Placing triggers.
What would be an efficient approach to achieve this?
Light sources can be added or removed as the game progresses
Ihor Majorov is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.