Is there any way to detect if a pawn is being lit?

Hi.

I got an idea to my project that would be easily implemented “IF” I could detect if a skeletal mesh is being lit (receiving direct light from sources on the map).

Another way I thought would be get some material node that does expose the light contribution (float?) on the actual shader result.

Does someone has any tip about where could I start?

Thank you.

This would imply on get all lights within the same range, or get the range on each light previously to traces. This will also not consider indirect light contribution above the characters’ mesh. :frowning:

You are able to get the Light Source Actors and make a trace from your character to them. If you have nothing in between and the character is in an certain range to the light, you can set a bool that tells your algorithm that the player is lit.

Hm, yeah, the indirect light could be a problem. The range thing could be managed by taking the strength of the light into a bit of math.

(: Let’s see if someone knows how to get a work around for the indirect light.