Hi all. I’m starting to work on a stealth game prototype for a personal project. I’m wondering how can I achieve getting hit results based on the intensity of light? In other words, I’d like to keep my playable character hidden when he is in the shadows. He can’t be detected from far, but if the enemy closes in, depending on the dynamic change in lighting, the enemy may or may not be able to see the player character. I guess, to help me get started with it, this is all I’d like to research on for now and as I build up on it, I might come up with more question.
+1, I’ve seen solutions to check whether or not a light source is directly shining on the player, but Id like to know more about the specific lighting intesity.
Would it kind of be a distance thing?
As light intensity decreases the further you are from a source of light.
Inverse square fall off (assuming it’s not the sun):
intensity = 1/distance^2, then multiply by the current brightness of the light source actor itself to get something to work with.
This is what I did, the intensity variable is just a variable that controls the intensity of the light.
Thanks, I’m going to try this and update here with the progress.