# setLightTangent (Cliente)

> Cambia hacia dónde apunta el ancho de una luz rect, girando el rectángulo alrededor de su normal.

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

## Sintaxis

```lua
bool setLightTangent(light light, float x, y, z)
```

## Parámetros

| Nombre | Tipo | Descripción |
| --- | --- | --- |
| `light` | `light` | La luz. |
| `x, y, z` | `float` | Dirección del ancho del rectángulo, tres números o un vec3. Se normaliza y se rehace perpendicular a la normal. Un vector nulo o paralelo a la normal registra un aviso y devuelve `false`. |

## Retorno

`true` si cambió. Con un argumento incorrecto, registra un aviso y devuelve `false`.

Mientras la luz está enganchada a otro elemento, la tangente es relativa a él.

## Ejemplo

```lua
local light = createRectLight(1481.0, -1771.0, 22.0, 0, -1, 0, 12)
setLightSize(light, 4, 0.5)
setLightTangent(light, 0, 0, 1)
```

### Atención

Solo para luces rect. En una luz point o spot, registra un aviso que dice su tipo y devuelve `false`.

## Ver también

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