Reference API Roblox

Engine API

Website

Related

Reference API Roblox

Sky

Changes the default appearance of the experience's sky.

Member index 21

HistoryMember
726CelestialBodiesShown: bool
726MoonAngularSize: float
726MoonTextureContent: Content
726MoonTextureId: ContentId
726SkyboxBackContent: Content
726SkyboxBk: ContentId
726SkyboxDn: ContentId
726SkyboxDownContent: Content
726SkyboxFrontContent: Content
726SkyboxFt: ContentId
726SkyboxLeftContent: Content
726SkyboxLf: ContentId
726SkyboxOrientation: Vector3
726SkyboxRightContent: Content
726SkyboxRt: ContentId
726SkyboxUp: ContentId
726SkyboxUpContent: Content
726StarCount: int
726SunAngularSize: float
726SunTextureContent: Content
726SunTextureId: ContentId
inherited from Instance
726Archivable: bool
726Capabilities: SecurityCapabilities
726IsInSandbox: bool
726Name: string
726Parent: Instance
726PredictionMode: PredictionMode
726Sandboxed: bool
726UniqueId: 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
726children(): Instances
726clone(): Instance
726destroy(): null
726findFirstChild(name: string, recursive: bool = false): Instance
726getChildren(): Instances
726isDescendantOf(ancestor: Instance): bool
726remove(): null
462AncestryChanged(child: Instance, parent: Instance)
462AttributeChanged(attribute: string)
462ChildAdded(child: Instance)
462ChildRemoved(child: Instance)
462DescendantAdded(descendant: Instance)
462DescendantRemoving(descendant: Instance)
500Destroying()
657StyledPropertiesChanged()
726childAdded(child: Instance)
inherited from Object
726ClassName: string
726className: string
647GetPropertyChangedSignal(property: string): RBXScriptSignal
647IsA(className: string): bool
726isA(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 87

Members 21

CelestialBodiesShown

TypeDefault
bool

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

History 5

MoonAngularSize

TypeDefault
float

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

History 5

MoonTextureContent

TypeDefault
Content

History 2

MoonTextureId

TypeDefault
ContentId

The texture of the moon while using this skybox.

History 6

SkyboxBackContent

TypeDefault
Content

History 2

SkyboxBk

TypeDefault
ContentId

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

History 6

SkyboxDn

TypeDefault
ContentId

Asset ID for the bottom surface of the skybox.

History 6

SkyboxDownContent

TypeDefault
Content

History 2

SkyboxFrontContent

TypeDefault
Content

History 2

SkyboxFt

TypeDefault
ContentId

Asset ID for the front surface of the skybox.

History 6

SkyboxLeftContent

TypeDefault
Content

History 2

SkyboxLf

TypeDefault
ContentId

Asset ID for the left surface of the skybox.

History 6

SkyboxOrientation

TypeDefault
Vector3

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 2

SkyboxRightContent

TypeDefault
Content

History 2

SkyboxRt

TypeDefault
ContentId

Asset ID for the right surface of the skybox.

History 6

SkyboxUp

TypeDefault
ContentId

Asset ID for the top surface of the skybox.

History 6

SkyboxUpContent

TypeDefault
Content

History 2

StarCount

TypeDefault
int

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

History 5

SunAngularSize

TypeDefault
float

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

History 5

SunTextureContent

TypeDefault
Content

History 2

SunTextureId

TypeDefault
ContentId

The texture of the sun while using this skybox.

History 6

Settings