FANDOM


Lighting is responsible for all lighting aspects of the world, affecting how objects are rendered. This class cannot be instantiated.

Properties

Pubfield Color3 Ambient

The hue of the global lighting. Changing this changes the color tint of all objects in the Workspace.

Category: Appearance.

Serialization: can save and load.

Pubfield float Brightness

How much global light each Part in the Workspace receives. Standard range is 0 to 1 (0 being little light), but can be increased all the way to 5 (colors start to be appear very different at this value).

Category: Appearance.

Serialization: can save and load.

Pubfield float ClockTime

A float version of the TimeOfDay property.

Example:

local lighting = game:GetService("Lighting")
lighting.ClockTime = 4repeat
    lighting.ClockTime = lighting.ClockTime + 1    wait(1)
until lighting.ClockTime == 0print("It's midnight!")

Category: Data.

Serialization: can load only.

Tags: NotReplicated.

Pubfield Color3 ColorShift_Bottom

The hue of global lighting on the bottom surfaces of an object.

Category: Appearance.

Serialization: can save and load.

Pubfield Color3 ColorShift_Top

The hue of global lighting on the top surfaces of an object.

Category: Appearance.

Serialization: can save and load.

Pubfield float ExposureCompensation

Exposure compensation amount. Applies a bias to the exposure level prior to the tonemap step. +1 indicates twice as much exposure and -1 means half as much exposure.

Category: Exposure.

Serialization: can save and load.

Pubfield Color3 FogColor

A Color3 value that changes the hue of distance fog.

Category: Fog.

Serialization: can save and load.

Pubfield float FogEnd

The distance at which fog completely blocks your vision. This distance is relative to the camera position. Units are in studs

Category: Fog.

Serialization: can save and load.

Pubfield float FogStart

The distance at which the fog gradient begins. This distance is relative to the camera position. Units are in studs.

Category: Fog.

Serialization: can save and load.

Pubfield float GeographicLatitude

The latitude position the level is placed at. This affects sun position.

Category: Data.

Serialization: can save and load.

Pubfield bool GlobalShadows

Flag enabling shadows from sun and moon in the place.

Category: Appearance.

Serialization: can save and load.

Pubfield bool LegacyOutlines

Category: Appearance.

Serialization: can save and load.

Tags: NotScriptable.

Pubfield Color3 OutdoorAmbient

Effective ambient value for outdoors, effectively shadow color outdoors (requires GlobalShadows enabled)

Category: Appearance.

Serialization: can save and load.

Pubfield bool Outlines

Flag enabling or disabling outlines on parts and terrain.

Category: Appearance.

Serialization: can save and load.

Pubfield Color3 ShadowColor

Color the shadows appear as. Shadows are drawn mostly for characters, but depending on the lighting will also show for Parts in the Workspace. Rendering settings can also affect if shadows are drawn.

Category: Appearance.

Serialization: can load only.

Tags: NotReplicated, Deprecated.

Pubfield float ShadowSoftness

This property controls how blurry the shadows are.

Category: Appearance.

Serialization: can save and load.

Pubfield Technology Technology

Category: Appearance.

Serialization: can save and load.

Tags: NotScriptable.

Pubfield string TimeOfDay

A string that represent the current time of day. Time is in 24-hour clock format "hh:mm:ss".

Category: Data.

Serialization: can save and load.

Functions

Pubmethod double GetMinutesAfterMidnight()

The number of minutes that the current time is past midnight. If currently at midnight, returns 0. Will return decimal values if not at an exact minute.

Pubmethod Vector3 GetMoonDirection()

Returns the lookVector (Vector3) of the moon. If this lookVector was used in a CFrame, the Part would face the moon.

Pubmethod float GetMoonPhase()

Currently always returns 0.75. MoonPhase cannot be edited.

Pubmethod Vector3 GetSunDirection()

Returns the lookVector (Vector3) of the sun. If this lookVector was used in a CFrame, the Part would face the sun.

Pubmethod void SetMinutesAfterMidnight(double minutes)

Sets the time to be a certain number of minutes after midnight. This works with integer and decimal values.

Pubmethod double getMinutesAfterMidnight()

Tags: Deprecated.

Pubmethod void setMinutesAfterMidnight(double minutes)

Tags: Deprecated.

Events

Pubevent LightingChanged(bool skyboxChanged)

Fired whenever a property of Lighting is changed, or a skybox is added or removed. Skyboxes are of type 'Sky' and should be parented directly to lighting.


External links

Community content is available under CC-BY-SA unless otherwise noted.