M MY Multiplayer: Wiki
Side
Kind

getLightDirection

Client

Reads where a spot or rect light points.

vec3|false getLightDirection(light light)

Parameters

NameTypeDescription
lightlightThe light.

Returns

A unit vec3, or false with a wrong argument.

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

Example

local light = createSpotLight(0, 0, 10, 1, 0, -1)
local dir = getLightDirection(light)
outputDebugString(("%.2f %.2f %.2f"):format(dir.x, dir.y, dir.z))
NoteSpot and rect lights only. On a point light it logs a warning and returns false.

See also