Class
Sky
Changes the default appearance of the experience's sky.
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.
Properties 21#
CelestialBodiesShownboolean | Sets whether the sun, moon, and stars will render in the skybox.ReadSafe |
MoonAngularSizefloat | The perceived angular size of the moon while using this skybox, in
degrees. Defaults to 11 and is clamped to the range [0, 60].ReadSafe |
MoonTextureContentContent | The image displayed for the moon while using this skybox.ReadSafe |
MoonTextureIdContentId | The texture of the moon while using this skybox.ReadSafe |
SkyboxBackContentContent | The image displayed on the back surface of the skybox.ReadSafe |
SkyboxBkContentId | The URL link to a picture for the back surface of the sky.ReadSafe |
SkyboxDnContentId | Asset ID for the bottom surface of the skybox.ReadSafe |
SkyboxDownContentContent | The image displayed on the bottom surface of the skybox.ReadSafe |
SkyboxFrontContentContent | The image displayed on the front surface of the skybox.ReadSafe |
SkyboxFtContentId | Asset ID for the front surface of the skybox.ReadSafe |
SkyboxLeftContentContent | The image displayed on the left surface of the skybox.ReadSafe |
SkyboxLfContentId | Asset ID for the left surface of the skybox.ReadSafe |
SkyboxOrientationVector3 | Angle of the skybox, in degrees, with rotation order of Y, X, Z.ReadSafe |
SkyboxRightContentContent | The image displayed on the right surface of the skybox.ReadSafe |
SkyboxRtContentId | Asset ID for the right surface of the skybox.ReadSafe |
SkyboxUpContentId | Asset ID for the top surface of the skybox.ReadSafe |
SkyboxUpContentContent | The image displayed on the top surface of the skybox.ReadSafe |
StarCountint | How many stars are shown in the skybox.ReadSafe |
SunAngularSizefloat | The perceived angular size of the sun while using this skybox, in degrees.ReadSafe |
SunTextureContentContent | The image displayed for the sun while using this skybox.ReadSafe |
SunTextureIdContentId | The texture of the sun while using this skybox.ReadSafe |
CelestialBodiesShown: boolean#
ReadSafe
Determines whether the sun, moon, and stars are rendered in the skybox.
Defaults to true. When set to false, the sun, moon, and stars are
hidden, regardless of the values of other properties.
MoonAngularSize: float#
ReadSafe
The perceived angular size of the moon while using this skybox, measured in degrees.
MoonTextureContent: Content#
ReadSafe
The Content image displayed for the moon while using this
skybox. Defaults to rbxasset://sky/moon.jpg.
MoonTextureId: ContentId#
ReadSafe
The texture asset ID for the moon while using this skybox. Defaults to
rbxasset://sky/moon.jpg.
SkyboxBackContent: Content#
ReadSafe
The Content image displayed on the back surface of the skybox.
Defaults to rbxasset://textures/sky/sky512_bk.tex.
SkyboxBk: ContentId#
ReadSafe
The texture asset ID for the back surface of the skybox. Defaults to
rbxasset://textures/sky/sky512_bk.tex.
SkyboxDn: ContentId#
ReadSafe
The texture asset ID for the bottom surface of the skybox. Defaults to
rbxasset://textures/sky/sky512_dn.tex.
SkyboxDownContent: Content#
ReadSafe
The Content image displayed on the bottom surface of the
skybox. Defaults to rbxasset://textures/sky/sky512_dn.tex.
SkyboxFrontContent: Content#
ReadSafe
The Content image displayed on the front surface of the skybox.
Defaults to rbxasset://textures/sky/sky512_ft.tex.
SkyboxFt: ContentId#
ReadSafe
The texture asset ID for the front surface of the skybox. Defaults to
rbxasset://textures/sky/sky512_ft.tex.
SkyboxLeftContent: Content#
ReadSafe
The Content image displayed on the left surface of the skybox.
Defaults to rbxasset://textures/sky/sky512_lf.tex.
SkyboxLf: ContentId#
ReadSafe
The texture asset ID for the left surface of the skybox. Defaults to
rbxasset://textures/sky/sky512_lf.tex.
SkyboxOrientation: Vector3#
ReadSafe
Changes the orientation of the skybox surfaces. This property takes a
Vector3 of degree values in the typical XYZ order, but
applies rotation first around the Y axis. After applying the Y
axis rotation, the orientation is applied to the X and Z axes to
allow for predictable control over complex movements. Your camera and
object orientation can affect how this rotation appears to be applied.
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.
SkyboxRightContent: Content#
ReadSafe
The Content image displayed on the right surface of the skybox.
Defaults to rbxasset://textures/sky/sky512_rt.tex.
SkyboxRt: ContentId#
ReadSafe
The texture asset ID for the right surface of the skybox. Defaults to
rbxasset://textures/sky/sky512_rt.tex.
SkyboxUp: ContentId#
ReadSafe
The texture asset ID for the top surface of the skybox. Defaults to
rbxasset://textures/sky/sky512_up.tex.
SkyboxUpContent: Content#
ReadSafe
The Content image displayed on the top surface of the skybox.
Defaults to rbxasset://textures/sky/sky512_up.tex.
StarCount: int#
ReadSafe
How many stars are shown in the skybox. Only works if
CelestialBodiesShown is true.
SunAngularSize: float#
ReadSafe
The perceived angular size of the sun while using this skybox, in degrees.
Defaults to 21 and is clamped to the range [0, 60].
SunTextureContent: Content#
ReadSafe
The Content image displayed for the sun while using this
skybox. Defaults to rbxasset://sky/sun.jpg.
SunTextureId: ContentId#
ReadSafe
The texture asset ID for the sun while using this skybox. Defaults to
rbxasset://sky/sun.jpg.
Inherited members#
Inherited from Instance 58
Properties (10)
Archivable, archivable, Capabilities, IsInSandbox, Name, Parent, PredictionMode, RobloxLocked, Sandboxed, UniqueId
Methods (39)
AddTag, children, ClearAllChildren, Clone, clone, Destroy, destroy, FindFirstAncestor, FindFirstAncestorOfClass, FindFirstAncestorWhichIsA, FindFirstChild, findFirstChild, FindFirstChildOfClass, FindFirstChildWhichIsA, FindFirstDescendant, GetActor, GetAttribute, GetAttributeChangedSignal, GetAttributes, GetChildren, getChildren, GetDebugId, GetDescendants, GetFullName, GetStyled, GetStyledPropertyChangedSignal, GetTags, HasTag, IsAncestorOf, IsDescendantOf, isDescendantOf, IsPropertyModified, QueryDescendants, Remove, remove, RemoveTag, ResetPropertyToDefault, SetAttribute, WaitForChild