# How to toggle lights only when it's night?

**URL:** <https://forums.unrealengine.com/t/how-to-toggle-lights-only-when-its-night/280651>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [April 15, 2014, 10:36am UTC](https://forums.unrealengine.com/t/how-to-toggle-lights-only-when-its-night/280651 "2014-04-15T10:36:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_e341cd19](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e341cd19](https://forums.unrealengine.com/u/anonymous_user_e341cd19)\
**Post date:** [April 15, 2014, 10:36am UTC](https://forums.unrealengine.com/t/how-to-toggle-lights-only-when-its-night/280651/1 "2014-04-15T10:36:52Z")

</div>

How do i make lights only turn on when it gets night?  
sorry if this was answered before but couldnt find it on this site

---

<div class="post-metadata">

**Author:** ![DizzyWes](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DizzyWes](https://forums.unrealengine.com/u/DizzyWes)\
**Post date:** [April 15, 2014, 1:12pm UTC](https://forums.unrealengine.com/t/how-to-toggle-lights-only-when-its-night/280651/2 "2014-04-15T13:12:31Z")

</div>

Howdy!

There’s a tutorial on the Wiki for setting up a basic Day/Night Cycle here:

> **[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...

Towards the end, it even gives you an example when to check for Night. You could use this to toggle the Visibility of lights similar to below I suppose.

 ![4113-nightlights.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/a/0/1a06f4d83926f48953eaa90426c9461ef963bc72.png)

Kudos to the guys who put up the posts and video on the Day/Night cycle.

Cheers,

-W

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e341cd19](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e341cd19](https://forums.unrealengine.com/u/anonymous_user_e341cd19)\
**Post date:** [April 16, 2014, 1:18pm UTC](https://forums.unrealengine.com/t/how-to-toggle-lights-only-when-its-night/280651/3 "2014-04-16T13:18:24Z")

</div>

ive added your stuff in between it , first it stopped my light from rotating so i changed the delta seconds, now it works but the light is always off?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e341cd19](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e341cd19](https://forums.unrealengine.com/u/anonymous_user_e341cd19)\
**Post date:** [April 16, 2014, 1:35pm UTC](https://forums.unrealengine.com/t/how-to-toggle-lights-only-when-its-night/280651/4 "2014-04-16T13:35:22Z")

</div>

i just noticed, its on until the first night? then it goes out and doesnt go on anymore?
