Get light intensity at specific location or detect if the player is visible? (Stealth game)

Is there a way to get the brightness of a specific world location?
We are making a stealth game and need this for detection of our NPCs and player feedback on the HUD.

I have looked into it and there are multiple ways to detect if a player is visible, however those I have found aren’t optimal or not really efficient:

1- Creating a child blueprint of the light and using a sphere arount the light for collision detection
(found here)

I would guess that this doesn’t work, since a player can be positioned inside the sphere of the light source and still not be visible if there is an object or a wall between the player and the light source - however the spherecollision would mark the player as visible even though he is not.

2- Using line traces from player extremities to all light sources with the player inside the attenuation radius. Every single tick.
This seems to be way too performance heavy.

So I’m looking for a way to do this which isn’t too performance heavy - If there was a way to get the light levels of a certain world location it would make things a lot easier, but I haven’t found out how to do that yet.

Hi zale90,

The functionally that you are looking for isn’t exposed to blueprints. You would need to either fake it using the trace method described in that post, use lights inside of blueprint actors that also contain a collision/trigger, or create your own solution in code.

Here is another post that has some additional data.

Cheers,

TJ

So there’s no way to do it?