Skip to main content
Version: latest - a1.73.x โš–๏ธ

๐ŸŒ… Sky

Interact with built-in Sky & Weather system.


๐Ÿ—ฟStatic Class
This is a Static Class. Access it's methods directly with .. It's not possible to spawn new instances.
๐Ÿ’‚Authority
This static class can be accessed only on ๐ŸŸง Client side.
๐Ÿง‘โ€๐Ÿ’ปAPI Source
This page is auto-generated! The Functions, Properties and Events described here are defined in our GitHub's API Repository! Feel free to commit suggestions and changes to the source .json API files!

nanos world natively integrates Ultra Dynamic Sky, one of best Unreal Marketplace Asset Packs, it provides a dynamic sky and weather solution for games!

Through the Sky class, we expose it's methods to allow customizing it's parameters in real time!

๐ŸŽ’ Examplesโ€‹

Client/Index.lua
-- Spawns a new Ultra Dynamic Sky actor
Sky.Spawn()

-- Sets the time to 16:30
Sky.SetTimeOfDay(16, 30)

๐Ÿ—ฟ Static Functionsโ€‹

ReturnsNameDescription
Changes the Weather
Destroys all Directional Lights, Sky Lights, Exponential Height Fogs, Volumetric Clouds, Sky Atmosphere, Ultra Dynamic Sky Actors and all Actors with the Sun Actor Tag from the Level
, , Gets the current time
Gets the current weather
Returns if the Ultra Dynamic Sky was spawned
Reconstruct the Ultra Dynamic Sky Actor, forces most of the changes to be applied
Sets whether or not to animate the time of day
The amount of coverage for the cloud layer, from a clear sky to overcast
A simple contrast boost for the sky material. Cannot affect volumetric clouds
The fogginess of the scene. The impact this has on fog density is scaled from the Fog Density category
Sets the Moon Angle
Sets the Moon Glow Intensity
Sets the Moon Light Intensity
Sets the Moon Phase
Sets the Moon Scale
Sets the Moon Texture
Sets the Moon Texture Rotation
Sets the Moon Vertical Offset
Can be used to scale the brightness of the sky and lighting, at night
The overall brightness of the shader
Sets the Sky Mode
Sets the Sun Angle
Sets the Sun Light Intensity
Sets the Sun Scale
Sets the current time
Sets the Volumetric Cloud Color
Replaces all Sky/Sun actors with the Ultra Dynamic Sky Actor, to be able to use the functions from this page

ChangeWeather

Changes the Weather

Sky.ChangeWeather(weather, transition_time)
TypeParameterDefaultDescription
weather Required parameter weather to change
transition_time Required parameter fade time to completely change to new weather

DestroyAllSky

Destroys all Directional Lights, Sky Lights, Exponential Height Fogs, Volumetric Clouds, Sky Atmosphere, Ultra Dynamic Sky Actors and all Actors with the Sun Actor Tag from the Level

Sky.DestroyAllSky()

GetTimeOfDay

Gets the current time

โ€” Returns , , (hours, minutes, seconds).

local ret_01, ret_02, ret_03 = Sky.GetTimeOfDay()

See also SetTimeOfDay.


GetWeather

Gets the current weather

โ€” Returns .

local ret = Sky.GetWeather()

IsSpawned

Returns if the Ultra Dynamic Sky was spawned

โ€” Returns .

local ret = Sky.IsSpawned(including_weather)
TypeParameterDefaultDescription
including_weather Required parameter if to check for Weather Actor too

Reconstruct

Reconstruct the Ultra Dynamic Sky Actor, forces most of the changes to be applied

Sky.Reconstruct()

SetAnimateTimeOfDay

Sets whether or not to animate the time of day

Sky.SetAnimateTimeOfDay(animate, day_length?, night_length?)
TypeParameterDefaultDescription
animate Required parameter Whether or not to animate the time of day
or day_length?30.0The time (in minutes) from sunrise to sunset
or night_length?15.0The time (in minutes) from sunset to sunrise

SetCloudCoverage

The amount of coverage for the cloud layer, from a clear sky to overcast

Sky.SetCloudCoverage(cloud_coverage)
TypeParameterDefaultDescription
cloud_coverage Required parameter No description provided

SetContrast

A simple contrast boost for the sky material. Cannot affect volumetric clouds

Sky.SetContrast(contrast)
TypeParameterDefaultDescription
contrast Required parameter No description provided

SetFog

The fogginess of the scene. The impact this has on fog density is scaled from the Fog Density category

Sky.SetFog(fog_percentage)
TypeParameterDefaultDescription
fog_percentage Required parameter No description provided

SetMoonAngle

Sets the Moon Angle

Sky.SetMoonAngle(yaw, pitch)
TypeParameterDefaultDescription
yaw Required parameter No description provided
pitch Required parameter No description provided

SetMoonGlowIntensity

Sets the Moon Glow Intensity

Sky.SetMoonGlowIntensity(glow_intensity)
TypeParameterDefaultDescription
glow_intensity Required parameter No description provided

SetMoonLightIntensity

Sets the Moon Light Intensity

Sky.SetMoonLightIntensity(intensity)
TypeParameterDefaultDescription
intensity Required parameter No description provided

SetMoonPhase

Sets the Moon Phase

Sky.SetMoonPhase(phase)
TypeParameterDefaultDescription
phase Required parameter Ranges from 0-30

SetMoonScale

Sets the Moon Scale

Sky.SetMoonScale(scale)
TypeParameterDefaultDescription
scale Required parameter No description provided

SetMoonTexture

Sets the Moon Texture

Set it to empty to restore the default. After setting it, you must call Sky.Reconstruct() to have it applied properly

Sky.SetMoonTexture(texture)
TypeParameterDefaultDescription
texture Required parameter No description provided

SetMoonTextureRotation

Sets the Moon Texture Rotation

Sky.SetMoonTextureRotation(rotation)
TypeParameterDefaultDescription
rotation Required parameter No description provided

SetMoonVerticalOffset

Sets the Moon Vertical Offset

Sky.SetMoonVerticalOffset(offset)
TypeParameterDefaultDescription
offset Required parameter No description provided

SetNightBrightness

Can be used to scale the brightness of the sky and lighting, at night

Sky.SetNightBrightness(brightness)
TypeParameterDefaultDescription
brightness Required parameter No description provided

SetOverallIntensity

The overall brightness of the shader

Sky.SetOverallIntensity(intensity)
TypeParameterDefaultDescription
intensity Required parameter No description provided

SetSkyMode

Sets the Sky Mode

After setting it, you must call Sky.Reconstruct() to have it applied properly

Sky.SetSkyMode(sky_mode)
TypeParameterDefaultDescription
sky_mode Required parameter No description provided

SetSunAngle

Sets the Sun Angle

Sky.SetSunAngle(yaw, pitch)
TypeParameterDefaultDescription
yaw Required parameter No description provided
pitch Required parameter No description provided

SetSunLightIntensity

Sets the Sun Light Intensity

Sky.SetSunLightIntensity(intensity)
TypeParameterDefaultDescription
intensity Required parameter No description provided

SetSunScale

Sets the Sun Scale

Sky.SetSunScale(radius)
TypeParameterDefaultDescription
radius Required parameter No description provided

SetTimeOfDay

Sets the current time

Sky.SetTimeOfDay(hours, minutes)
TypeParameterDefaultDescription
hours Required parameter No description provided
minutes Required parameter No description provided

See also GetTimeOfDay.


SetVolumetricCloudColor

Sets the Volumetric Cloud Color

This is only applied if SetSkyMode(SkyMode.VolumetricClouds) is set

Sky.SetVolumetricCloudColor(color)
TypeParameterDefaultDescription
Colorcolor Required parameter No description provided

Spawn

Replaces all Sky/Sun actors with the Ultra Dynamic Sky Actor, to be able to use the functions from this page. Internally this calls Sky.DestroyAllSky() automatically

Sky.Spawn(spawn_weather?, find_existing?)
TypeParameterDefaultDescription
spawn_weather?falseWhether or not to spawn the Weather Actor (to be able to use Weather related methods)
find_existing?trueWhether or not to try to find existing Sky & Weather Actors spawned in the map, using their references instead

๐Ÿš€ Eventsโ€‹

This class doesn't have own events.