# setLightTangent (Client)

> Changes where a rect light's width points, turning the rectangle about its normal.

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

## Syntax

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

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `light` | `light` | The light. |
| `x, y, z` | `float` | Direction of the rectangle's width, three numbers or a vec3. It is normalised and made across the normal. A zero vector or one along the normal logs a warning and returns `false`. |

## Returns

`true` if it changed. With a wrong argument it logs a warning and returns `false`.

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

## Example

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

### Note

Rect lights only. On a point or spot light it logs a warning naming its type and returns `false`.

## See also

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