Detect light perceived by player camera
Is there a way to detect the sunlight intensity at a given spot? I want my character to look away when facing the sun or another intense light source but couldn't find a good approach for this yet.
asked Sep 03 '18 at 08:41 AM in Blueprint Scripting
One way you could go about this is tracing from right in front the eyes of your character into lightsources in a radius and the level directional light, AKA "the sun". If you hit the lightsource or nothing at all is because your character is seeing it and hence you can make it look in another direction. This is however a very basic implementation that you should work on to improve (like takingn in acount the actual direction the character is facing before doing the traces, calculating the intensity of the light hiting the character eyes based on distance, etc,etc), but it would be a good place to start from my perspective.
answered Sep 04 '18 at 02:16 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here