O'Reilly logo

Unreal Engine Game Development Cookbook by John P. Doran

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a Day/Night cycle

If we are creating an open world title or any kind of game where the player is outdoors, one thing that would be nice is the ability to have our world change the time of day at the same rate.

Getting ready

Before we start working, we should have a level created with a Sky_Sphere and a directional light (the default map has this). To be sure, you can use the DayNightCycle-Before map from the example code folder.

How to do it…

Perform the following steps to create a day/night cycle:

  1. As we discussed before, we can use Directional Lights to act like the sun. For our day/night cycle we will want our lighting to change over time, so let's select the DirectionalLightStationary object from the Scene Outliner tab and then from the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required