M MY Multiplayer: Wiki
Side
Kind

setLightBarnDoor

Client

Changes a rect light's barn doors, which limit where the light leaves the rectangle.

bool setLightBarnDoor(light light, float angle, float length)

Parameters

NameTypeDescription
lightlightThe light.
anglefloatAngle of the barn doors from the normal, from 0 to 90 degrees. From 88 up they block nothing.
lengthfloatLength of the barn doors in metres, 0 or more.

Returns

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

A new light starts at 88 degrees and 0.2 metres.

Example

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

See also