Passer au contenu principal
Version: bleeding-edge 🩸

🌅 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
The methods, properties and events descriptions from this page are defined in our GitHub API Repository!

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
ChangeWeatherGets the current time
DestroyAllSkyDestroys 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
integer, integer, integerGetTimeOfDayGets the current time
WeatherTypeGetWeatherGets the current weather
booleanIsSpawnedReturns if the Ultra Dynamic Sky was spawned
ReconstructReconstruct the Ultra Dynamic Sky Actor, forces most of the changes to be applied
SetAnimateTimeOfDaySets whether or not to animate the time of day
SetCloudCoverageThe amount of coverage for the cloud layer, from a clear sky to overcast
SetContrastA simple contrast boost for the sky material. Cannot affect volumetric clouds
SetFogThe fogginess of the scene. The impact this has on fog density is scaled from the Fog Density category
SetMoonGlowIntensitySets the Moon Glow Intensity
SetMoonLightIntensitySets the Moon Light Intensity
SetMoonPhaseSets the Moon Phase
SetMoonScaleSets the Moon Scale
SetMoonTextureSets the Moon Texture
SetMoonTextureRotationSets the Moon Texture Rotation
SetMoonVerticalOffsetSets the Moon Vertical Offset
SetNightBrightnessCan be used to scale the brightness of the sky and lighting, at night
SetOverallIntensityThe overall brightness of the shader
SetSkyModeSets the Sky Mode
SetSunAngleSets the Sun Angle
SetSunLightIntensitySets the Sun Light Intensity
SetSunRadiusSets the Sun Radius
SetTimeOfDaySets the current time
SetVolumetricCloudColorSets the Volumetric Cloud Color
SpawnReplaces all Sky/Sun actors with the Ultra Dynamic Sky Actor, to be able to use the functions from this page

ChangeWeather

Gets the current time

Sky.ChangeWeather(weather, transition_time)
TypeParameterDefaultDescription
WeatherTypeweatherweather to change
floattransition_timefade 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 integer, integer, integer (hours, minutes, seconds).

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

See also SetTimeOfDay.


GetWeather

Gets the current weather

— Returns WeatherType.

local ret = Sky.GetWeather()

IsSpawned

Returns if the Ultra Dynamic Sky was spawned

— Returns boolean.

local ret = Sky.IsSpawned(including_weather)
TypeParameterDefaultDescription
booleanincluding_weatherif 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
booleananimateWhether or not to animate the time of day
float or nilday_length?30.0The time (in minutes) from sunrise to sunset
float or nilnight_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
floatcloud_coverage

SetContrast

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

Sky.SetContrast(contrast)
TypeParameterDefaultDescription
floatcontrast

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
floatfog_percentage

SetMoonGlowIntensity

Sets the Moon Glow Intensity

Sky.SetMoonGlowIntensity(glow_intensity)
TypeParameterDefaultDescription
floatglow_intensity

SetMoonLightIntensity

Sets the Moon Light Intensity

Sky.SetMoonLightIntensity(intensity)
TypeParameterDefaultDescription
floatintensity

SetMoonPhase

Sets the Moon Phase

Sky.SetMoonPhase(phase)
TypeParameterDefaultDescription
floatphaseRanges from 0-30

SetMoonScale

Sets the Moon Scale

Sky.SetMoonScale(scale)
TypeParameterDefaultDescription
floatscale

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
Image Pathtexture

SetMoonTextureRotation

Sets the Moon Texture Rotation

Sky.SetMoonTextureRotation(rotation)
TypeParameterDefaultDescription
floatrotation

SetMoonVerticalOffset

Sets the Moon Vertical Offset

Sky.SetMoonVerticalOffset(offset)
TypeParameterDefaultDescription
floatoffset

SetNightBrightness

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

Sky.SetNightBrightness(brightness)
TypeParameterDefaultDescription
floatbrightness

SetOverallIntensity

The overall brightness of the shader

Sky.SetOverallIntensity(intensity)
TypeParameterDefaultDescription
floatintensity

SetSkyMode

Sets the Sky Mode

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

Sky.SetSkyMode(sky_mode)
TypeParameterDefaultDescription
SkyModesky_mode

SetSunAngle

Sets the Sun Angle

Sky.SetSunAngle(angle)
TypeParameterDefaultDescription
floatangle

SetSunLightIntensity

Sets the Sun Light Intensity

Sky.SetSunLightIntensity(intensity)
TypeParameterDefaultDescription
floatintensity

SetSunRadius

Sets the Sun Radius

Sky.SetSunRadius(radius)
TypeParameterDefaultDescription
floatradius

SetTimeOfDay

Sets the current time

Sky.SetTimeOfDay(hours, minutes)
TypeParameterDefaultDescription
integerhours
integerminutes

See also GetTimeOfDay.


SetVolumetricCloudColor

Sets the Volumetric Cloud Color

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

Sky.SetVolumetricCloudColor(color)
TypeParameterDefaultDescription
Colorcolor

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?)
TypeParameterDefaultDescription
booleanspawn_weather?falseWhether or not to spawn the Weather Actor (to be able to use Weather related methods)

🚀 Events

This class doesn't have own events.