So I want for some objects in my 2D topdown game to react to the lighting around it.
One possible solution I found was to add colliders to every light object and on collision we give the object that is being lit the intensity of the light maybe multiplied by the inverse of the Falloff Intensity and somehow also putting the distance between the light and the player into the equation.
This way of solving the issue doesn’t really work as some lights have additional variables, for example the point 2d light has an inner and an outer radius and there is also freeform lights etc. which make such simple equations not really work in all cases.
So my question is, is there some way to actually just measure the amount of light hitting a certain point or a certain object? I saw some threads about using textures but didn’t know if that worked for 2D as well or if there is maybe some smarter way to solve the problem as those threads were all quite old.
Thank you in advance and I hope somebody can help me with this or knows an easy way of doing this
Did someone figured out how to do this?