# getLightDirection (Cliente)

> Lee hacia dónde apunta una luz spot o rect.

- **Plataforma**: MY Multiplayer (MYMP)
- **Tipo**: Función Lua
- **Lado**: Cliente
- **Categoría**: Luces
- **URL**: https://wiki.mymp.gg/es/getLightDirection

## Sintaxis

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

## Parámetros

| Nombre | Tipo | Descripción |
| --- | --- | --- |
| `light` | `light` | La luz. |

## Retorno

Un `vec3` unitario, o `false` con un argumento incorrecto.

Mientras la luz está enganchada a otro elemento, la dirección es relativa a él.

## Ejemplo

```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))
```

### Atención

Solo para luces spot y rect. En una luz point, registra un aviso y devuelve `false`.

## Ver también

- [setLightDirection (Cliente)](https://wiki.mymp.gg/es/setLightDirection.md): Cambia hacia dónde apunta una luz spot o rect.
- [getLightTangent (Cliente)](https://wiki.mymp.gg/es/getLightTangent.md): Lee hacia dónde apunta el ancho de una luz rect.
