Skip to main content

Light

Light controls an authored directional Light component. RGB channels are 8-bit values. The editor preview and PS1 renderer consume the same authored state through different rendering paths, so validate the final result in the release CUE.

MethodReturnsDescription
Light.Has(gameObjectId)booleanChecks for a Light component.
Light.GetDirection(gameObjectId)Vec3 or nilReads direction.
Light.SetDirection(gameObjectId, x, y, z)booleanSets direction; runtime normalizes it.
Light.GetColor(gameObjectId)RGB table or nilReads directional color.
Light.SetColor(gameObjectId, r, g, b)booleanSets directional color.
Light.GetIntensity(gameObjectId)number or nilReads intensity.
Light.SetIntensity(gameObjectId, intensity)booleanSets validated intensity.
Light.GetAmbient(gameObjectId)RGB table or nilReads ambient color.
Light.SetAmbient(gameObjectId, r, g, b)booleanSets ambient color.
lightGameObjectId = -1

function WarmLighting(gameObjectId)
if Light.Has(lightGameObjectId) then
Light.SetColor(lightGameObjectId, 255, 208, 160)
Light.SetAmbient(lightGameObjectId, 48, 36, 32)
Light.SetIntensity(lightGameObjectId, 1.25)
end
end