I’ve done some research into ways to detect if players are under light, and although there are many, none have covered (at least from what I can find) when the player is underneath the clouds.
My intent is that I want my player character to “absorb” light from the sun and other light sources, and to create moving clouds that block the path to that sun. Image below for example:
](filedata/fetch?id=1783531&d=1593708744)
Here, white stick figures are in light and absorb those great looking sunrays I drew out. Black stick figures are in shadow and do not absorb that sunlight. Players are able to see the clouds as well.
My experience in Blueprints is beginner, since I am by trade a character artist, but I do know enough to add HP/MP to my character, so metering that light is not a problem.
So, I guess my questions are:
Is there a built in cloud system within UE4 that would do something like this? I’ve tested **light functions **and putting them on my sun (directional light attached to the skyphere BP), but the raytrace from the character to the light source still detects that there is light when character is under shadows.
if there isn’t a built in cloud system, is there any way to accomplish this intent on the character? (creating moving clouds and detect if blocking sunlight from character)
This would be likely be not too hard if you use a dynamic/stationary skylight, in that case use a light function with the cloud transparency texture, or something similar.
By skylight, did you mean skysphere? Because so far, I have tried applying a light function to the directional light that is attached to the default skysphere, and the character still detects light from the directional light. However, I may be interpreting the response incorrectly, any specifics would help a lot.
I meant directional light, apologies, you likely dont need to do anything BP side, just dim the lights whenever its under a cloud, via the cloud alpha channel and some shader tricks, unless you dont have a plane or volumetric clouds, then, i dont know exactly what to do there.