# llGetMoonDirection

*LSL function*

```lsl
vector vector llGetMoonDirection();
```

- Returns: `vector`
- Energy: 10

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

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

## 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: [LlGetMoonDirection](https://wiki.secondlife.com/wiki/LlGetMoonDirection) on the Second Life Wiki. Content from the Second Life Wiki article LlGetMoonDirection (revision 1211038, 2022-08-23), CC BY-SA 3.0.*

---

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