Reference API Roblox

Engine API

Website

Related

Reference API Roblox

Sky

Changes the default appearance of the experience's sky.

Member index 21

HistoryMember
731CelestialBodiesShown: bool
731MoonAngularSize: float
731MoonTextureContent: Content
731MoonTextureId: ContentId
731SkyboxBackContent: Content
731SkyboxBk: ContentId
731SkyboxDn: ContentId
731SkyboxDownContent: Content
731SkyboxFrontContent: Content
731SkyboxFt: ContentId
731SkyboxLeftContent: Content
731SkyboxLf: ContentId
731SkyboxOrientation: Vector3
731SkyboxRightContent: Content
731SkyboxRt: ContentId
731SkyboxUp: ContentId
731SkyboxUpContent: Content
731StarCount: int
731SunAngularSize: float
731SunTextureContent: Content
731SunTextureId: ContentId
inherited from Instance
731Archivable: bool
731Capabilities: SecurityCapabilities
731IsInSandbox: bool
731Name: string
731Parent: Instance
731PredictionMode: PredictionMode
731Sandboxed: bool
731UniqueId: UniqueId
576AddTag(tag: string): null
573ClearAllChildren(): null
462Clone(): Instance
573Destroy(): null
486FindFirstAncestor(name: string): Instance
486FindFirstAncestorOfClass(className: string): Instance
486FindFirstAncestorWhichIsA(className: string): Instance
486FindFirstChild(name: string, recursive: bool = false): Instance
486FindFirstChildOfClass(className: string): Instance
486FindFirstChildWhichIsA(className: string, recursive: bool = false): Instance
486FindFirstDescendant(name: string): Instance
563GetActor(): Actor
486GetAttribute(attribute: string): Variant
462GetAttributeChangedSignal(attribute: string): RBXScriptSignal
631GetAttributes(): Dictionary
648GetChildren(): Instances
462GetDebugId(scopeLength: int = 4): string
707GetDescendants(): Instances
486GetFullName(): string
706GetStyled(name: string, selector: string?): Variant
657GetStyledPropertyChangedSignal(property: string): RBXScriptSignal
576GetTags(): Array
576HasTag(tag: string): bool
486IsAncestorOf(descendant: Instance): bool
486IsDescendantOf(ancestor: Instance): bool
664IsPropertyModified(property: string): bool
698QueryDescendants(selector: string): Instances
573Remove(): null
576RemoveTag(tag: string): null
664ResetPropertyToDefault(property: string): null
573SetAttribute(attribute: string, value: Variant): null
462WaitForChild(childName: string, timeOut: double): Instance
731children(): Instances
731clone(): Instance
731destroy(): null
731findFirstChild(name: string, recursive: bool = false): Instance
731getChildren(): Instances
731isDescendantOf(ancestor: Instance): bool
731remove(): null
462AncestryChanged(child: Instance, parent: Instance)
462AttributeChanged(attribute: string)
462ChildAdded(child: Instance)
462ChildRemoved(child: Instance)
462DescendantAdded(descendant: Instance)
462DescendantRemoving(descendant: Instance)
500Destroying()
657StyledPropertiesChanged()
731childAdded(child: Instance)
inherited from Object
731ClassName: string
731className: string
647GetPropertyChangedSignal(property: string): RBXScriptSignal
647IsA(className: string): bool
731isA(className: string): bool
647Changed(property: string)

Description

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.

History 108

Members 21

CelestialBodiesShown

TypeDefault
booltrue

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.

History 6

MoonAngularSize

TypeDefault
float11

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

History 6

MoonTextureContent

TypeDefault
Content

The Content image displayed for the moon while using this skybox. Defaults to rbxasset://sky/moon.jpg.

History 3

MoonTextureId

TypeDefault
ContentIdrbxasset://sky/moon.jpg

The texture asset ID for the moon while using this skybox. Defaults to rbxasset://sky/moon.jpg.

History 7

SkyboxBackContent

TypeDefault
Content

The Content image displayed on the back surface of the skybox. Defaults to rbxasset://textures/sky/sky512_bk.tex.

History 3

SkyboxBk

TypeDefault
ContentIdrbxasset://textures/sky/sky512_bk.tex

The texture asset ID for the back surface of the skybox. Defaults to rbxasset://textures/sky/sky512_bk.tex.

History 7

SkyboxDn

TypeDefault
ContentIdrbxasset://textures/sky/sky512_dn.tex

The texture asset ID for the bottom surface of the skybox. Defaults to rbxasset://textures/sky/sky512_dn.tex.

History 7

SkyboxDownContent

TypeDefault
Content

The Content image displayed on the bottom surface of the skybox. Defaults to rbxasset://textures/sky/sky512_dn.tex.

History 3

SkyboxFrontContent

TypeDefault
Content

The Content image displayed on the front surface of the skybox. Defaults to rbxasset://textures/sky/sky512_ft.tex.

History 3

SkyboxFt

TypeDefault
ContentIdrbxasset://textures/sky/sky512_ft.tex

The texture asset ID for the front surface of the skybox. Defaults to rbxasset://textures/sky/sky512_ft.tex.

History 7

SkyboxLeftContent

TypeDefault
Content

The Content image displayed on the left surface of the skybox. Defaults to rbxasset://textures/sky/sky512_lf.tex.

History 3

SkyboxLf

TypeDefault
ContentIdrbxasset://textures/sky/sky512_lf.tex

The texture asset ID for the left surface of the skybox. Defaults to rbxasset://textures/sky/sky512_lf.tex.

History 7

SkyboxOrientation

TypeDefault
Vector30, 0, 0

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:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
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.

History 3

SkyboxRightContent

TypeDefault
Content

The Content image displayed on the right surface of the skybox. Defaults to rbxasset://textures/sky/sky512_rt.tex.

History 3

SkyboxRt

TypeDefault
ContentIdrbxasset://textures/sky/sky512_rt.tex

The texture asset ID for the right surface of the skybox. Defaults to rbxasset://textures/sky/sky512_rt.tex.

History 7

SkyboxUp

TypeDefault
ContentIdrbxasset://textures/sky/sky512_up.tex

The texture asset ID for the top surface of the skybox. Defaults to rbxasset://textures/sky/sky512_up.tex.

History 7

SkyboxUpContent

TypeDefault
Content

The Content image displayed on the top surface of the skybox. Defaults to rbxasset://textures/sky/sky512_up.tex.

History 3

StarCount

TypeDefault
int3000

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

History 6

SunAngularSize

TypeDefault
float21

The perceived angular size of the sun while using this skybox, in degrees. Defaults to 21 and is clamped to the range [0, 60].

History 6

SunTextureContent

TypeDefault
Content

The Content image displayed for the sun while using this skybox. Defaults to rbxasset://sky/sun.jpg.

History 3

SunTextureId

TypeDefault
ContentIdrbxasset://sky/sun.jpg

The texture asset ID for the sun while using this skybox. Defaults to rbxasset://sky/sun.jpg.

History 7

Settings