# llGetRegionSunDirection

*LSL function*

```lsl
vector vector llGetRegionSunDirection();
```

- Returns: `vector`
- Energy: 10

Returns a normalized vector to the current sun position at the location of object containing the script. [llGetSunDirection](/functions/llGetSunDirection/) is the vector to the parcel's sun, [llGetRegionSunDirection](/functions/llGetRegionSunDirection/) is the vector to region's sun. If there is no custom environment set for the current parcel [llGetSunDirection](/functions/llGetSunDirection/) returns the direction to the region's sun. These functions are altitude aware.

```lsl title="How to use" frame="terminal"
vector result = llGetRegionSunDirection();
```

## See also

### Functions

- [llGetEnvironment](/functions/llGetEnvironment/)

Newer function that consolidates many environment-based settings.

- [llGetDayLength](/functions/llGetDayLength/)
- [llGetDayOffset](/functions/llGetDayOffset/)
- [llGetMoonDirection](/functions/llGetMoonDirection/)
- [llGetMoonRotation](/functions/llGetMoonRotation/)
- [llGetSunDirection](/functions/llGetSunDirection/)
- [llGetSunRotation](/functions/llGetSunRotation/)
- [llGetRegionDayLength](/functions/llGetRegionDayLength/)
- [llGetRegionDayOffset](/functions/llGetRegionDayOffset/)
- [llGetRegionMoonDirection](/functions/llGetRegionMoonDirection/)
- [llGetRegionMoonRotation](/functions/llGetRegionMoonRotation/)
- [llGetRegionSunDirection](/functions/llGetRegionSunDirection/)
- [llGetRegionSunRotation](/functions/llGetRegionSunRotation/)

---

*Source: [LlGetRegionSunDirection](https://wiki.secondlife.com/wiki/LlGetRegionSunDirection) on the Second Life Wiki. Content from the Second Life Wiki article LlGetRegionSunDirection (revision 1211046, 2022-08-23), CC BY-SA 3.0.*

---

From lsl.dev: https://lsl.dev/functions/llGetRegionSunDirection/
