# How to have a sun that rotates around the world horizontally without ever setting?

**URL:** <https://forums.unrealengine.com/t/how-to-have-a-sun-that-rotates-around-the-world-horizontally-without-ever-setting/665553>\
**Category:** World Creation\
**Tags:** Sky, unreal-engine, question\
**Created:** [October 9, 2022, 10:02am UTC](https://forums.unrealengine.com/t/how-to-have-a-sun-that-rotates-around-the-world-horizontally-without-ever-setting/665553 "2022-10-09T10:02:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![PanoramicPorpoise](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@PanoramicPorpoise](https://forums.unrealengine.com/u/PanoramicPorpoise)\
**Post date:** [October 9, 2022, 10:02am UTC](https://forums.unrealengine.com/t/how-to-have-a-sun-that-rotates-around-the-world-horizontally-without-ever-setting/665553/1 "2022-10-09T10:02:45Z")

</div>

Trying to setup a world where the sun rotates around the world without ever setting. When I add the rotator to the directional light though I can’t get it to rotate on a horizontal plane, it always dips below the horizon and I get a night cycle I don’t want.

Hopefully not too difficult but I’ve been tearing my hair out over it. Help is appreciated.

---

<div class="post-metadata">

**Author:** ![vespineauto007](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@vespineauto007](https://forums.unrealengine.com/u/vespineauto007)\
**Post date:** [October 9, 2022, 2:05pm UTC](https://forums.unrealengine.com/t/how-to-have-a-sun-that-rotates-around-the-world-horizontally-without-ever-setting/665553/2 "2022-10-09T14:05:26Z")

</div>

So… …if I have a game and I look straight up and watch the sun, you want it to, essentially, be rotating in a circle. Yes?

I wanted day and night transitions so I have three things rotating in the sky: sun, moon and stars.

Regardless, I have these items managed both in the persistent level and the game mode. I have a dispatcher which links the system together to address issues/challenges switching from night to day and day to night.

I have the position of these items stored in the game mode.

I have a 500ms timer in the game mode that is incrementing a Y-axis position variable for these actors. If you watch the sky actors, the action is not smooth at 500ms; however, I believe it is sufficient for my needs.

I have another timer in the persistent level which reads the gamemode variables and applies them to actors via SetActorRotation.

I suppose an equation could be created and applied to SetActorRotation to cause the sun actor to rotate above the terrain without setting.

I claim this should work.

---

<div class="post-metadata">

**Author:** ![MostHost\_LA](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mosthost_la/32/907035_2.png) [@MostHost\_LA](https://forums.unrealengine.com/u/MostHost_LA)\
**Post date:** [October 10, 2022, 2:39am UTC](https://forums.unrealengine.com/t/how-to-have-a-sun-that-rotates-around-the-world-horizontally-without-ever-setting/665553/3 "2022-10-10T02:39:05Z")

</div>

With the old SysphereBP all you have to do is use a different axis on your directional light.

Realistically, you probably want to compute fhe rotation given a declination and a right ascention.

It may be faster to set up the sun position calculator at one of the 2 poles, and set the time to when its daylight (6 months of each day/night).
