# How to Keep Sun Direction Fixed While Globe Rotates in Cesium for Unreal?

**URL:** <https://community.cesium.com/t/how-to-keep-sun-direction-fixed-while-globe-rotates-in-cesium-for-unreal/40497>\
**Category:** Cesium for Unreal\
**Created:** [May 8, 2025, 11:27am UTC](https://community.cesium.com/t/how-to-keep-sun-direction-fixed-while-globe-rotates-in-cesium-for-unreal/40497 "2025-05-08T11:27:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Piyush\_Verma](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/piyush_verma/32/28947_2.png) [@Piyush\_Verma](https://community.cesium.com/u/Piyush_Verma)\
**Post date:** [May 8, 2025, 11:27am UTC](https://community.cesium.com/t/how-to-keep-sun-direction-fixed-while-globe-rotates-in-cesium-for-unreal/40497/1 "2025-05-08T11:27:18Z")

</div>

**Hi Cesium team,**

I’m working on a Google Earth-style application in Unreal Engine using Cesium for Unreal and I have a question about lighting behavior.

### 🎯 Goal:

I want the **globe to rotate** , but the **sunlight direction should stay fixed** , simulating how the real Earth rotates around a fixed sun (creating the day/night cycle).

### ✅ Expected Behavior:

- Earth rotates freely.
- Directional light (sun) remains **fixed in world space**.
- This mimics **realistic sunlight behavior** , like Google Earth or NASA visualizations.

### 🛠 Current Setup:

- I’m using the `CesiumSunSky` actor.
- Globe is rendering fine.
- I noticed that as I rotate the Earth, the sunlight seems to stay in the correct world direction — but I want to confirm:
  - **Is this the intended behavior of CesiumSunSky?**
  - Do I need to manually update the sun direction or is it handled automatically?

### ❓ Questions:

1. How does `CesiumSunSky` keep the directional light synced with real-world sun?
2. Is there a way to **lock the sun direction** so that it always simulates real-world sunlight, even when the user moves/rotates the globe manually?
3. What is the best way to simulate **real-time day/night cycle** for a rotating globe?

### 🔧 What I’m Trying to Achieve:

I want to rotate the Earth manually (e.g., via user interaction), and the **lighting should behave exactly like in Google Earth** — where the Earth rotates, but the sun stays fixed in a real-time direction.

Thanks in advance for the help! Looking forward to building something beautiful with Cesium

---

<div class="post-metadata">

**Author:** ![janine](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/janine/32/5135_2.png) [@janine](https://community.cesium.com/u/janine)\
**Post date:** [May 8, 2025, 2:01pm UTC](https://community.cesium.com/t/how-to-keep-sun-direction-fixed-while-globe-rotates-in-cesium-for-unreal/40497/2 "2025-05-08T14:01:28Z")

</div>

Hi @Piyush_Verma, this looks similar to the thread you previously opened here:

> [@How to Fix the Sun Direction and Rotate the Globe Like Google Earth?](https://community.cesium.com/t/how-to-fix-the-sun-direction-and-rotate-the-globe-like-google-earth/40424/4):
>
> Looks cool! Do you have a specific question?

Can you pick which thread you’d prefer to discuss on so we don’t duplicate our answers? Thank you!

---

<div class="post-metadata">

**Author:** ![Piyush\_Verma](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/piyush_verma/32/28947_2.png) [@Piyush\_Verma](https://community.cesium.com/u/Piyush_Verma)\
**Post date:** [May 8, 2025, 2:37pm UTC](https://community.cesium.com/t/how-to-keep-sun-direction-fixed-while-globe-rotates-in-cesium-for-unreal/40497/3 "2025-05-08T14:37:18Z")

</div>

This one because I clear my question
