# Day/night cycle tied to UI widget clock

**URL:** <https://forums.unrealengine.com/t/day-night-cycle-tied-to-ui-widget-clock/566118>\
**Category:** Blueprint\
**Tags:** UEnum, unreal-engine, UE4, question\
**Created:** [May 25, 2022, 12:49pm UTC](https://forums.unrealengine.com/t/day-night-cycle-tied-to-ui-widget-clock/566118 "2022-05-25T12:49:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheEp1cMission](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TheEp1cMission](https://forums.unrealengine.com/u/TheEp1cMission)\
**Post date:** [May 25, 2022, 12:49pm UTC](https://forums.unrealengine.com/t/day-night-cycle-tied-to-ui-widget-clock/566118/1 "2022-05-25T12:49:13Z")

</div>

Hi,  
I am trying to make a game similar to Digimon World from the PS1. Currently I am trying to implement a time system with a clock.

For context: in the game your digimon will get tired at night and each day that passes will increase it’s age by 1. A full day in the game takes 24 minutes.

I have used level blueprint and the skysphere to make a rudimentary cycle but I am having a bit of trouble with a few aspects.  
1: Simply getting the time for a full day correct.  
2: Using it to control functions with the player/partner such as an indicator that they are tired and the age increasing.  
3: Tying this to a UI clock so that the clock shows the accurate time of day. I have made a widget to represent the clock and made a clock hand rotate but it is not in sync or accurate.

Another thing that I am curious about is, in future, I have different locations as different levels in the engine, then since the day/night cycle is done in the level blueprint would this mess with everything?

I know that I am asking about a lot of things here and it will be difficult to answer but any help would be greatly appreciated. Thanks

---

<div class="post-metadata">

**Author:** ![Dejan33](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dejan33/32/1194514_2.png) [@Dejan33](https://forums.unrealengine.com/u/Dejan33)\
**Post date:** [May 25, 2022, 1:12pm UTC](https://forums.unrealengine.com/t/day-night-cycle-tied-to-ui-widget-clock/566118/2 "2022-05-25T13:12:08Z")

</div>

> **[Geographically Accurate Sun Positioning](https://docs.unrealengine.com/4.27/en-US/BuildingWorlds/LightingAndShadows/SunPositioner/)**
>
> Control the position of the sun by specifying the position of your Level on the globe, the date, and the time of day.

> **[Sun and Sky Actor](https://docs.unrealengine.com/4.27/en-US/BuildingWorlds/LightingAndShadows/SunSky/)**
>
> An overview of the setup and usage of the SunSky Actor with the SkyAtmosphere component.

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/2/c/12c01500d2f2579f757894eb27b551b979039e5e.jpeg "Real World Sun Position - Unreal Engine 4 Tutorial") ](https://www.youtube.com/watch?v=sXu_YAM9c_0)

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/3/f/93fff6db8ebbd0a802f0bfcee9784c82f332e7d8.jpeg "Sun Position Driven by UI | Tips & Tricks | Unreal Engine") ](https://www.youtube.com/watch?v=_Sdm_gsbaos)

---

<div class="post-metadata">

**Author:** ![TheEp1cMission](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TheEp1cMission](https://forums.unrealengine.com/u/TheEp1cMission)\
**Post date:** [May 29, 2022, 11:59am UTC](https://forums.unrealengine.com/t/day-night-cycle-tied-to-ui-widget-clock/566118/3 "2022-05-29T11:59:46Z")

</div>

Hi, thanks for the response.  
I’m not really trying to get a geographically accurate sun position. The Sun Position Driven by UI video is one I’ve looked at before but I’m not quite sure how to translate what is shown into what I want.  
Since I am not controlling the sun, it is moving normally and the UI clock is turning at the same speed & representing the correct time of day.
