M MY Multiplayer: Wiki
Side
Kind

setLightTangent

Client

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

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

Parameters

NameTypeDescription
lightlightThe light.
x, y, zfloatDirection 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

local light = createRectLight(1481.0, -1771.0, 22.0, 0, -1, 0, 12)
setLightSize(light, 4, 0.5)
setLightTangent(light, 0, 0, 1)
NoteRect lights only. On a point or spot light it logs a warning naming its type and returns false.

See also