# getLightDirection (Client)

> Reads where a spot or rect light points.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Client
- **Category**: Lights
- **URL**: https://wiki.mymp.gg/en/getLightDirection

## Syntax

```lua
vec3|false getLightDirection(light light)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `light` | `light` | The light. |

## Returns

A unit `vec3`, or `false` with a wrong argument.

While the light is attached to another element, the direction is relative to it.

## Example

```lua
local light = createSpotLight(0, 0, 10, 1, 0, -1)
local dir = getLightDirection(light)
outputDebugString(("%.2f %.2f %.2f"):format(dir.x, dir.y, dir.z))
```

### Note

Spot and rect lights only. On a point light it logs a warning and returns `false`.

## See also

- [setLightDirection (Client)](https://wiki.mymp.gg/en/setLightDirection.md): Changes where a spot or rect light points.
- [getLightTangent (Client)](https://wiki.mymp.gg/en/getLightTangent.md): Reads where a rect light's width points.
