๐ Sky
Interact with built-in Sky & Weather system

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โ
-- Spawns a new Ultra Dynamic Sky actor
Sky.Spawn()
-- Sets the time to 16:30
Sky.SetTimeOfDay(16, 30)
๐ฟ Static Functionsโ
| Atmosphere | ||
ChangeWeather | Changes the Weather | |
GetWeather: WeatherType | Gets the current weather | |
SetCloudCoverage | The amount of coverage for the cloud layer, from a clear sky to overcast | |
SetFog | The fogginess of the scene. The impact this has on fog density is scaled from the Fog Density category. With weather spawned it also pins the weather's fog to this value, so later weather changes keep it, until called with nil | |
SetSkyMode | Sets the Sky Mode | |
SetVolumetricCloudColor | Sets the Volumetric Cloud Color | |
| Lifecycle | ||
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 | |
IsSpawned: boolean | Returns if the Ultra Dynamic Sky was spawned | |
Reconstruct | Reconstruct the Ultra Dynamic Sky Actor, forces most of the changes to be applied | |
Spawn: boolean | Replaces all Sky/Sun actors with the Ultra Dynamic Sky Actor, to be able to use the functions from this page | |
| Lighting | ||
SetContrast | A simple contrast boost for the sky material. Cannot affect volumetric clouds | |
SetNightBrightness | Can be used to scale the brightness of the sky and lighting, at night | |
SetOverallIntensity | The overall brightness of the shader | |
SetSunAngle | Sets the Sun Angle | |
SetSunLightIntensity | Sets the Sun Light Intensity | |
SetSunScale | Sets the Sun Scale | |
| Moon | ||
SetMoonAngle | Sets the Moon Angle | |
SetMoonGlowIntensity | Sets the Moon Glow Intensity | |
SetMoonLightColor | Sets the Moon Light Color, the color of the light the moon casts at night | |
SetMoonLightIntensity | Sets the Moon Light Intensity | |
SetMoonMaterialColor | Sets the Moon Material Color, which tints the moon texture | |
SetMoonPhase | Sets the Moon Phase, from new moon to full moon and back | |
SetMoonScale | Sets the Moon Scale | |
SetMoonTexture | Sets the Moon Texture | |
SetMoonTextureRotation | Sets the Moon Texture Rotation | |
SetMoonVerticalOffset | Sets the Moon Vertical Offset | |
| Time | ||
GetTimeOfDay: integer, integer, integer | Gets the current time | |
SetAnimateTimeOfDay | Sets whether or not to animate the time of day | |
SetTimeOfDay | Sets the current time | |
Atmospherestatic functionsโ

ChangeWeatherModerateโ
Changes the Weather
Sky.ChangeWeather(weather, transition_time)
Parameters
| Name | Type | Beschreibung |
|---|---|---|
weather | WeatherType | weather to change |
transition_time | float | fade time to completely change to new weather |

GetWeatherModerateโ
Gets the current weather
local ret = Sky.GetWeather()
Returns
| Type | Beschreibung |
|---|---|
| WeatherType | Current weather |

SetCloudCoverageModerateโ
The amount of coverage for the cloud layer, from a clear sky to overcast
Sky.SetCloudCoverage(cloud_coverage)
Parameters
| Name | Type | Beschreibung |
|---|---|---|
cloud_coverage | float | From 0 (clear sky) to 10 (overcast) |

SetFogModerateโ
The fogginess of the scene. The impact this has on fog density is scaled from the Fog Density category. With weather spawned it also pins the weather's fog to this value, so later weather changes keep it, until called with nil
Sky.SetFog(fog_percentage?)

SetSkyModeModerateโ
Sets the Sky Mode
After setting it, you must call Sky.Reconstruct() to have it applied properly
Sky.SetSkyMode(sky_mode)
Parameters
| Name | Type | Beschreibung |
|---|---|---|
sky_mode | SkyMode | The new Sky Mode |

SetVolumetricCloudColorModerateโ
Sets the Volumetric Cloud Color
This is only applied if SetSkyMode(SkyMode.VolumetricClouds) is set
Sky.SetVolumetricCloudColor(color)
Parameters
| Name | Type | Beschreibung |
|---|---|---|
color | Color | The new Volumetric Cloud Color |
Lifecyclestatic functionsโ

DestroyAllSkyModerateโ
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()

IsSpawnedOptimalโ
Returns if the Ultra Dynamic Sky was spawned
local ret = Sky.IsSpawned(including_weather)
Parameters
| Name | Type | Beschreibung |
|---|---|---|
including_weather | boolean | if to check for Weather Actor too |
Returns
| Type | Beschreibung |
|---|---|
| boolean | Whether the Ultra Dynamic Sky was spawned |

ReconstructSlowโ
Reconstruct the Ultra Dynamic Sky Actor, forces most of the changes to be applied
Sky.Reconstruct()

SpawnSlowโ
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
local ret = Sky.Spawn(spawn_weather?, find_existing?)
Parameters
| Name | Type | Beschreibung |
|---|---|---|
spawn_weather? | boolean | Whether or not to spawn the Weather Actor (to be able to use Weather related methods) Default false |
find_existing? | boolean | Whether or not to try to find existing Sky & Weather Actors spawned in the map, using their references instead Default true |
Returns
| Type | Beschreibung |
|---|---|
| boolean | true if an existing Ultra Dynamic Sky Actor was found in the map and its reference was used, false if a new one was spawned |
Lightingstatic functionsโ

SetContrastModerateโ
A simple contrast boost for the sky material. Cannot affect volumetric clouds
Sky.SetContrast(contrast)
Parameters
| Name | Type | Beschreibung |
|---|---|---|
contrast | float | Contrast multiplier of the sky |

SetNightBrightnessModerateโ
Can be used to scale the brightness of the sky and lighting, at night
Sky.SetNightBrightness(brightness)
Parameters
| Name | Type | Beschreibung |
|---|---|---|
brightness | float | Brightness multiplier at night |

SetOverallIntensityModerateโ
The overall brightness of the shader
Sky.SetOverallIntensity(intensity)
Parameters
| Name | Type | Beschreibung |
|---|---|---|
intensity | float | Brightness multiplier of the sky |

SetSunLightIntensityModerateโ
Sets the Sun Light Intensity
Sky.SetSunLightIntensity(intensity)
Parameters
| Name | Type | Beschreibung |
|---|---|---|
intensity | float | The new Sun Light Intensity |

SetSunScaleModerateโ
Sets the Sun Scale
Sky.SetSunScale(radius)
Parameters
| Name | Type | Beschreibung |
|---|---|---|
radius | float | The new Sun Scale |
Moonstatic functionsโ

SetMoonGlowIntensityModerateโ
Sets the Moon Glow Intensity
Sky.SetMoonGlowIntensity(glow_intensity)
Parameters
| Name | Type | Beschreibung |
|---|---|---|
glow_intensity | float | The new Moon Glow Intensity |

SetMoonLightColorModerateโ
Sets the Moon Light Color, the color of the light the moon casts at night
Sky.SetMoonLightColor(color)
Parameters
| Name | Type | Beschreibung |
|---|---|---|
color | Color | The new Moon Light Color |

SetMoonLightIntensityModerateโ
Sets the Moon Light Intensity
Sky.SetMoonLightIntensity(intensity)
Parameters
| Name | Type | Beschreibung |
|---|---|---|
intensity | float | The new Moon Light Intensity |

SetMoonMaterialColorModerateโ
Sets the Moon Material Color, which tints the moon texture
Call Reconstruct() afterwards to apply it
Sky.SetMoonMaterialColor(color)
Parameters
| Name | Type | Beschreibung |
|---|---|---|
color | Color | The new Moon Material Color |

SetMoonPhaseModerateโ
Sets the Moon Phase, from new moon to full moon and back
Sky.SetMoonPhase(phase)
Parameters
| Name | Type | Beschreibung |
|---|---|---|
phase | float | Ranges from 0-30 |

SetMoonScaleModerateโ
Sets the Moon Scale
Sky.SetMoonScale(scale)
Parameters
| Name | Type | Beschreibung |
|---|---|---|
scale | float | The new Moon Scale |

SetMoonTextureSlowโ
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)
Parameters
| Name | Type | Beschreibung |
|---|---|---|
texture | Image Path | The new Moon Texture |

SetMoonTextureRotationModerateโ
Sets the Moon Texture Rotation
Sky.SetMoonTextureRotation(rotation)
Parameters
| Name | Type | Beschreibung |
|---|---|---|
rotation | float | The new Moon Texture Rotation |

SetMoonVerticalOffsetModerateโ
Sets the Moon Vertical Offset
Sky.SetMoonVerticalOffset(offset)
Parameters
| Name | Type | Beschreibung |
|---|---|---|
offset | float | The new Moon Vertical Offset |
Timestatic functionsโ

GetTimeOfDayModerateโ
Gets the current time
local hours, minutes, seconds = Sky.GetTimeOfDay()
See also SetTimeOfDay.

SetAnimateTimeOfDayModerateโ
Sets whether or not to animate the time of day
Sky.SetAnimateTimeOfDay(animate, day_length?, night_length?)

SetTimeOfDayModerateโ
Sets the current time
Sky.SetTimeOfDay(hours, minutes, transition_time?)
Parameters
| Name | Type | Beschreibung |
|---|---|---|
hours | integer | Hour of the day (0-23) |
minutes | integer | Minutes (0-59) |
transition_time? | float or nil | Seconds to smoothly transition to the new time, 0 to change immediately Default 0.0 |
See also GetTimeOfDay.
๐ Eventsโ
This class doesn't have own events.


