Hi all. I made the change in the time of day in the Level blueprint using the Sun position calculator plugin. I want to make it possible to change the intensity of the lamp depending on the time, but I’m not good at BP. I welcome any help and advice.
Hey @AstraVortex
You can do something like this inside the SunSky blueprint in the UpdateSun function:
This is a Math Expression with following equation:
(((pow((x - Noon), 2)) * LightTimeFactor) + MaxIntensity)
Which will generate a parabola like this for your intensity (Y=intensity, X=SolarTime):
The site for the graph: https://www.desmos.com/
The equation: -.5*(x-12)^2+20
And copy this to another folder in your project:


I will definitely try, thanks
Oh…
So you want to set your lamp to be the one beeing adjusted. Sry, I thought lamp was a typo and you meant light as in directional light.
Then you can do something similar. I can later create an example. But you could:
-Use an event dispatcher to call the function in your lamp from the sun
-Use a reference of your lamp inside the SunPosition. Then you can use the lamp reference with SetIntensity like in the screenshot I showed you. And set the LightTimeFactor in the MathExpression to be positive, like 0.5 instead of -0.5
Hey @AstraVortex
here is an example.
-Inside SunSky I created a timer on EventBeginPlay

-The looped function updates the time of the SunSky
-
Then I created an EventDispatcher called SetLampIntensity in SunSky

-
SetLampIntensity gets called when the sun is updated with UpdateSun
-
In the lamp I added this:
The lamp now gets an update and an new intensity when the sun gets updated
427_SunAndLamp.zip (521.6 KB)
Thank you very much helped a lot









