I wanted to investigate how to create an adjustable day to night cycle using Unreal Editor, analysing how the lighting affects the look and feel of an environment. My ultimate intention is to create a cycle which is adjustable at the choice of the player, whether it be with a slider widget or a simple choice of day and night.
I scoured the internet for tutorials on the matter but any decent ones were hard to come by. To get me started however, I created a scene where the directional light source and the sky box rotated on the y axis in conjunction with each other. This gave the impression of the sun rising and setting, with the sky box providing a day and night scene. This was created all within a blueprint.
The blueprint also included a real-time day system using floats using calculations which represents days, hours and minutes. The speed in which the day goes by can be edited using the “Day Length in Minutes” variable, this will come in handy for quicker transitions from day to night.
The code in motion is shown below:
Now, I want to add some sort of lateral movement to make the suns movement more realistic, also to include a moon into the sky box.
Finally, adding some kind of interface which will allow the player to change the time of day on the fly.