Player hide in darkness

I’m making a survival horror game like Amnesia or Soma. In my player blueprint I’ve created a simple float called “visibility”, that will detect how lights affect him. 0 is not visible and 1 is completely visible. Is there any way to get the level lighting in real time to do this? I searched but I only found add a trigger to the light and when player collide set the visibility value to 1, but it dont work when you are searching an smooth and dynamic system.

Any idea or hidden editor tool I can use?

There is some ue4 games that use the darkness for hide from monster, so this is not impossible to do. Maybe I’ll must to use c++ or it will be enough with blueprints?

Thanks

Generally it is impossible via using blueprints alone and at the same time impractical. You solution should be completely separate from actual graphical lighting. Think about placing trigger objects that would correspond to light frustum, and check how much player collider overlaps with them. Alternatively, consider doing raycasts from play to the light, to determine if something is in between.

I don’t know if that’s enough for you, but you could do a trace to all the light actors, if it hits the a light, you are NOT in darkness. That’s not optimal I know but it might suffice.