Skip to content
Untitled Sandbox - Developer Documentation
docs/types/Lighting

Lighting

The time of day, sky, fog and light of your place, which your scripts read and change through world.lighting.

Fields

clocknumber
cycle_minutesnumber
day_skystring
night_skystring
ambient_colorColor
ambient_strengthnumber
exposurenumber
brightnessnumber
fog_colorColor
fog_startnumber
fog_endnumber
fog_heightnumber
fog_thicknessnumber
fog_densitynumber

Lighting:tween

method

Smoothly changes the time of day, the fog or the light over a set time.

example
world.lighting:tween({ clock = 18, duration = 5 })

Use it forsunsets, storms rolling in, or a spooky night slowly falling.

optionsThe target values, how long it takes and the easing.
Build a tween callduration · clock · cycle_minutes · ambient_color · ambient_strength · exposure · 8 more
  • durationrequired

    How many seconds the tween takes to finish.

  • clock

    The time of day to reach, from 0 to 24, and the clock always moves forward to get there.

  • cycle_minutes

    How many minutes a whole day takes, where 0 stops the clock.

  • ambient_color

    The color the ambient light blends to over the tween.

  • ambient_strength

    How strong the ambient light becomes by the end of the tween.

  • exposure

    The camera exposure to blend to over the tween.

  • brightness

    How bright the sun becomes by the end of the tween.

  • fog_color

    The color of both fogs, the distance fog and the ground fog.

  • fog_start

    How many studs from the camera the fog begins.

  • fog_end

    How many studs from the camera the fog is at its thickest.

  • fog_height

    The height at which the ground fog is at its thickest.

  • fog_thickness

    How many studs above fog_height the ground fog takes to thin out.

  • fog_density

    How thick the ground fog is, from 0, which is off, to 1.

  • easing

    How the change speeds up and slows down: linear, or quad, sine, cubic, quart, expo, back, bounce or elastic followed by _in, _out or _in_out.

    for example
↑ ↓ moveEnter openEsc close