Im fairly new to Bps so I need help.Basically I’m making a day night cycle based off the sky sphere BP.
I’am able to make the sun rotation and the day and night cycle I have is set to 96 tracks in the timeline.
I wanted also to have each day start with a different value for the cloud and transition from one random value to another over the course of 1 day(96 sec in game)
So I made a dynamic material instance of the cloud panning material so I can manipulate the scalar param NoisePower1 which controls the cloud formations.
In my event graph I set up a event start node that randomly sets the initial variable of NoisePower1 to a float value in range.
My question is how do I transition between that initial value to another random float value in range every 96 seconds?
You will be transitioning from current value to goal value. You should only modify the goal value. The goal value is whatever random float you want to blend to.
Use interpto for those things. Simple increasing/decreasing values in per tick is very fps dependent, so you would need some timed event, or logic that triggers your event only very seconds or such. Interpto solves most of that. And it has one more benefit.
You randomly pick starting and ending velues, they interpto, and there is no worry about if this need increment or decrement, interpto solves it all.
Now there is problem with speed and how to make it interpto for exactly 96 seconds to get from value to value. I think speed has something to do with it, but never found exact formula.
There are also 2 variants of each interpto, constant and normal one. Constant is constant trough all time until it reaches goal, while normal one tries to softly “touch” end result, or smooth transition during last part.
Also for sun and day / night mechanics, i would recommend simulating basic orbital movement of sun and moon. Orbit values are easily found in google, you can scale down distances and sizes, so numbers are not insane. Its some simple vector math, not trivial however. But this way you can get much more accurate and flexible system. For eg. with calculated moon position (instead of “hardcoded” timelines) you can simulate eclipse or tidal waves instead of adding yet another timeline. When you know location of sun in 3d space (instead of timeline) simple dot product of up vector [0,0,1] and sun location can tell you how high sun is and it is nice value to make dusk/dawn orange color or to get atmosphere or star brightness. All those things done with timelines will complicate everything.
PS. great node for all interpto and float comparsion is “nearly equal” it is sometimes better than compare float,