# UMG, how to change time of day (sun position) with a slider?

**URL:** <https://forums.unrealengine.com/t/umg-how-to-change-time-of-day-sun-position-with-a-slider/298722>\
**Category:** UI\
**Tags:** slider, unreal-engine, Blueprint, question, UMG\
**Created:** [November 11, 2014, 9:46am UTC](https://forums.unrealengine.com/t/umg-how-to-change-time-of-day-sun-position-with-a-slider/298722 "2014-11-11T09:46:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ghuuuu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ghuuuu](https://forums.unrealengine.com/u/ghuuuu)\
**Post date:** [November 11, 2014, 9:46am UTC](https://forums.unrealengine.com/t/umg-how-to-change-time-of-day-sun-position-with-a-slider/298722/1 "2014-11-11T09:46:10Z")

</div>

Hi guys!

I have been trying to get a working prototype of a slider created in widget BP, to correspond to a Time of Day (TOD) system but to no avail. Can anyone give me some help? So far, I have this created:

My Level Blueprint

 ![20735-1.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/e/b/0eb28124e28d13b47aea747e53a4ee8dc50b330a.jpeg)

My Widget Blueprint

 ![20736-2.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/8/e/08e040c587d6228385908487e452f0b3789ed2a7.jpeg)

In-game Widget

 ![20738-3.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/b/3/bb31ea732b465133b2a0d590c347f2a45ad43b25.jpeg)

As you can see above, I want to be able to press spacebar, the slider appears, and i can change the TOD, hit spacebar again and continue back to the game. I have the spacebar thingy set up, so no worries about that. I just need to get the slider to change the TOD. Thank you for the help!

---

<div class="post-metadata">

**Author:** ![robbiecooper](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@robbiecooper](https://forums.unrealengine.com/u/robbiecooper)\
**Post date:** [November 11, 2014, 9:54am UTC](https://forums.unrealengine.com/t/umg-how-to-change-time-of-day-sun-position-with-a-slider/298722/2 "2014-11-11T09:54:38Z")

</div>

I think you’ll have to create a class of widget that talks to the persistent level.  
[A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums](https://wiki.unrealengine.com/UMG,_How_to_extend_a_UUserWidget::_for_UMG_in_C%2B%2B).

You need the slider position to relate to set actor rotation in the persistent level. I’m not sure how you’d do that without creating your own class of widget…

---

<div class="post-metadata">

**Author:** ![ghuuuu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ghuuuu](https://forums.unrealengine.com/u/ghuuuu)\
**Post date:** [November 11, 2014, 2:11pm UTC](https://forums.unrealengine.com/t/umg-how-to-change-time-of-day-sun-position-with-a-slider/298722/3 "2014-11-11T14:11:41Z")

</div>

Hi robbiecooper, thanks for the reply. However I really have no idea how to create a class widget that talks to the level. I did have a look at the link you gave me, but I dont really have scripting background. But I will try it and get back to you. Thanks!

---

<div class="post-metadata">

**Author:** ![ghuuuu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ghuuuu](https://forums.unrealengine.com/u/ghuuuu)\
**Post date:** [November 12, 2014, 6:58am UTC](https://forums.unrealengine.com/t/umg-how-to-change-time-of-day-sun-position-with-a-slider/298722/4 "2014-11-12T06:58:06Z")

</div>

i have done it, I created a class widget, but am stuck now. What do I do with it?

---

<div class="post-metadata">

**Author:** ![robbiecooper](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@robbiecooper](https://forums.unrealengine.com/u/robbiecooper)\
**Post date:** [November 12, 2014, 7:33am UTC](https://forums.unrealengine.com/t/umg-how-to-change-time-of-day-sun-position-with-a-slider/298722/5 "2014-11-12T07:33:49Z")

</div>

Well done! You’ve created a class of widget btw.

So now take a look at the BP you’re trying to reach. It’s the Sky\_Sphere BP and sits in the level. The C++ class that has the level’s functions etc is the levelscriptactor. Follow this tutorial to reparent your level with your own custom levelscriptactor;

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_a539495d](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_a539495d](https://forums.unrealengine.com/u/anonymous_user_a539495d)\
**Post date:** [October 11, 2016, 9:24am UTC](https://forums.unrealengine.com/t/umg-how-to-change-time-of-day-sun-position-with-a-slider/298722/6 "2016-10-11T09:24:58Z")

</div>

I’m unsure if this thread is still active, but I too am looking into developing something of similarity to ghuuu. I am unsure what to do regarding robbiecooper’s last comment as I am very new to C++ working primarily in BP. Can you offer any help?
