Hi guys, first sorry for my english if I write something stupid.
Well, my question is: Is there a way to get the light that is affecting a pawn or a character such as the player?
My player has a “fear” progress bar, which in dark areas it grows, and below light areas it decreases. I don’t have any idea to do that. Adding a collider to point lights I could
make something work. But with SpotLights or Sky light I dont have any idea. Any help would be nice.
Thanks in advance.
Hey, the basic way is to trace to every light source around your character and see if the trace is blocked or not. You can use a sphere that overlap with the lights (pointlight and spotlight) and in a for each loop you line trace to the light and if the trace is not block the light affects the character. To know how much the light affects it, you can look at the light intensity and divide that with the distance from you character and you have a basic idea.
Thanks man, its what I though, another user gave me a good tip to use sphere colliders with the SpotLights. Now I am trying to set the sphere collider radius and relative position to each parent by the attenuation radius cone angle of the light, but I think I am having some trouble. Can I see the sphere collider while playing to see if the position and radius it is ok? Thanks for the reply ^^