# Can you make a day/night cycle based off real life?

**URL:** <https://forums.unrealengine.com/t/can-you-make-a-day-night-cycle-based-off-real-life/405618>\
**Category:** Rendering\
**Tags:** real-time, unreal-engine, Lighting, day-night-cycle, UE4, question, Blueprint\
**Created:** [September 27, 2017, 11:26pm UTC](https://forums.unrealengine.com/t/can-you-make-a-day-night-cycle-based-off-real-life/405618 "2017-09-27T23:26:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mw138](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mw138/32/639835_2.png) [@mw138](https://forums.unrealengine.com/u/mw138)\
**Post date:** [September 27, 2017, 11:26pm UTC](https://forums.unrealengine.com/t/can-you-make-a-day-night-cycle-based-off-real-life/405618/1 "2017-09-27T23:26:17Z")

</div>

Hey, is it possible to create a day/night cycle that is based off real life? So if it is night time in real life, it will be night time in-game etc.

---

<div class="post-metadata">

**Author:** ![Ramboozled](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ramboozled/32/1068816_2.png) [@Ramboozled](https://forums.unrealengine.com/u/Ramboozled)\
**Post date:** [September 27, 2017, 11:49pm UTC](https://forums.unrealengine.com/t/can-you-make-a-day-night-cycle-based-off-real-life/405618/2 "2017-09-27T23:49:39Z")

</div>

Hi! It should be possible. Lets say you have already a day/night cycle setup like [this tutorial](https://unrealcommunity.wiki/tutorial:-time-of-day-y1t0diwc) which it makes it rotate slightly every tick depending on a variable called “SunSpeed”. You would need to change the setup so a single variable sets the rotation of light/sun. Ideally you end up with a float variable that when its value is 0 = day and 1 = night.

After you achieve this you only need to get the current time and interpolate the values. (ex. 12:00 = 0 to make it day and 24:00 = 1 to make it night). Hope this helped you ^^

_Ram_

_Programmer at [UNF Games](http://unfgames.com)_

---

<div class="post-metadata">

**Author:** ![APPY130216](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@APPY130216](https://forums.unrealengine.com/u/APPY130216)\
**Post date:** [June 14, 2023, 3:31pm UTC](https://forums.unrealengine.com/t/can-you-make-a-day-night-cycle-based-off-real-life/405618/3 "2023-06-14T15:31:45Z")

</div>

Hi! I’m using UE5.1.1 and wat to create the same mechanic of real time day and night cycle. Could you please share the tutorial link once again as the Unreal Engine Wiki is permanently offline now.  
Thank you!

---

<div class="post-metadata">

**Author:** ![Ramboozled](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ramboozled/32/1068816_2.png) [@Ramboozled](https://forums.unrealengine.com/u/Ramboozled)\
**Post date:** [August 12, 2023, 1:05am UTC](https://forums.unrealengine.com/t/can-you-make-a-day-night-cycle-based-off-real-life/405618/4 "2023-08-12T01:05:19Z")

</div>

They moved it to this page [Tutorial: Time of Day | Unreal Engine Community Wiki](https://unrealcommunity.wiki/tutorial:-time-of-day-y1t0diwc)
