Sky

Show Deprecated

The Sky object, when placed inside Lighting, changes the default appearance of the experience's sky. This object's skybox is composed of six sides, like a cube. Rotation of the skybox can be changed through SkyboxOrientation.

The skybox sun, moon, and other celestial objects remain visible unless you turn off the CelestialBodiesShown property. By adjusting the StarCount property, you can change how many stars appear in the sky at night.

This object can also be used as a cubemap for reflections in ViewportFrames, in which case only the Sky object's six‑side Skybox[…] properties are used. For details, see viewport frames.

Summary

Properties

  • Sets whether the sun, moon, and stars will show.

  • Read Parallel

    The perceived angular size of the moon while using this skybox, in degrees.

  • MoonTextureId:ContentId
    Read Parallel

    The texture of the moon while using this skybox.

  • SkyboxBk:ContentId
    Read Parallel

    The URL link to a picture for the back surface of the sky.

  • SkyboxDn:ContentId
    Read Parallel

    Asset ID for the bottom surface of the skybox.

  • SkyboxFt:ContentId
    Read Parallel

    Asset ID for the front surface of the skybox.

  • SkyboxLf:ContentId
    Read Parallel

    Asset ID for the left surface of the skybox.

  • Angle of the skybox, in degrees, with rotation order of Y, X, Z.

  • SkyboxRt:ContentId
    Read Parallel

    Asset ID for the right surface of the skybox.

  • SkyboxUp:ContentId
    Read Parallel

    Asset ID for the top surface of the skybox.

  • Read Parallel

    How many stars are shown in the skybox.

  • Read Parallel

    The perceived angular size of the sun while using this skybox, in degrees.

  • SunTextureId:ContentId
    Read Parallel

    The texture of the sun while using this skybox.

Properties

CelestialBodiesShown

Read Parallel

Sets whether the sun, moon, and stars will show.

MoonAngularSize

Read Parallel

The perceived angular size of the moon while using this skybox, in degrees.

MoonTextureId

ContentId
Read Parallel

The texture of the moon while using this skybox.

SkyboxBk

ContentId
Read Parallel

The URL link to a picture for the back surface of the sky.

SkyboxDn

ContentId
Read Parallel

Asset ID for the bottom surface of the skybox.

SkyboxFt

ContentId
Read Parallel

Asset ID for the front surface of the skybox.

SkyboxLf

ContentId
Read Parallel

Asset ID for the left surface of the skybox.

SkyboxOrientation

Read Parallel

Changes the orientation of the skybox surfaces. This property takes a Vector3 of degree values in the typical XYZ order, but rotation is applied first around the Y axis, then X, and then Z to allow for predictable control over complex movements.

An easy way to script an orientation animation is to spin around the Y axis (keeping the horizon level), then tilt this axis by setting X and Z to a fixed value:


local Lighting = game:GetService("Lighting")
local RunService = game:GetService("RunService")
local sky = Lighting:FindFirstChild("Sky")
local ROTATION_SPEED = 5 -- In degrees per second
RunService.Heartbeat:Connect(function(deltaTime)
sky.SkyboxOrientation = Vector3.new(
30,
(sky.SkyboxOrientation.Y + ROTATION_SPEED * deltaTime) % 360,
0
)
end)

See here for further info and limitations.

Code Samples

Skybox Orientation with Tween

local Lighting = game:GetService("Lighting")
local RunService = game:GetService("RunService")
local TweenService = game:GetService("TweenService")
local sky = Lighting:FindFirstChild("Sky")
local ROTATION_SPEED = 4 -- In degrees per second
local MAX_TILT = 2 -- In degrees
local TILT_SPEED = 4
local currentTilt = Instance.new("NumberValue")
currentTilt.Value = -MAX_TILT
local tweenGoal = { Value = MAX_TILT }
local tweenInfo = TweenInfo.new(TILT_SPEED, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut, -1, true)
local tween = TweenService:Create(currentTilt, tweenInfo, tweenGoal)
tween:Play()
RunService.Heartbeat:Connect(function(deltaTime)
sky.SkyboxOrientation = Vector3.new(
currentTilt.Value,
(sky.SkyboxOrientation.Y + ROTATION_SPEED * deltaTime) % 360,
0
)
end)

SkyboxRt

ContentId
Read Parallel

Asset ID for the right surface of the skybox.

SkyboxUp

ContentId
Read Parallel

Asset ID for the top surface of the skybox.

StarCount

Read Parallel

How many stars are shown in the skybox. Only works if CelestialBodiesShown is true.

SunAngularSize

Read Parallel

The perceived angular size of the sun while using this skybox, in degrees.

SunTextureId

ContentId
Read Parallel

The texture of the sun while using this skybox.

Methods

Events