🌅 Sky
Interact with built-in Sky & Weather system

nanos world intègre nativement Ultra Dynamic Sky, l'un des meilleurs Asset Packs du Marketplace d'Unreal, qui offre un ciel dynamique et un système météo pour les jeux !
Grâce à la classe Sky, nous exposons ses méthodes pour permettre la personnalisation de ses paramètres en temps réel !
🎒 Exemples
-- 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)
Paramètres
| Name | Type | Description |
|---|---|---|
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 | Description |
|---|---|
| WeatherType | Current weather |

SetCloudCoverageModerate
The amount of coverage for the cloud layer, from a clear sky to overcast
Sky.SetCloudCoverage(cloud_coverage)
Paramètres
| Name | Type | Description |
|---|---|---|
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)
Paramètres
| Name | Type | Description |
|---|---|---|
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)
Paramètres
| Name | Type | Description |
|---|---|---|
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)
Paramètres
| Name | Type | Description |
|---|---|---|
including_weather | boolean | if to check for Weather Actor too |
Returns
| Type | Description |
|---|---|
| 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?)
Paramètres
| Name | Type | Description |
|---|---|---|
spawn_weather? | boolean | Whether or not to spawn the Weather Actor (to be able to use Weather related methods) Par défaut false |
find_existing? | boolean | Whether or not to try to find existing Sky & Weather Actors spawned in the map, using their references instead Par défaut true |
Returns
| Type | Description |
|---|---|
| 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)
Paramètres
| Name | Type | Description |
|---|---|---|
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)
Paramètres
| Name | Type | Description |
|---|---|---|
brightness | float | Brightness multiplier at night |

SetOverallIntensityModerate
The overall brightness of the shader
Sky.SetOverallIntensity(intensity)
Paramètres
| Name | Type | Description |
|---|---|---|
intensity | float | Brightness multiplier of the sky |

SetSunLightIntensityModerate
Sets the Sun Light Intensity
Sky.SetSunLightIntensity(intensity)
Paramètres
| Name | Type | Description |
|---|---|---|
intensity | float | The new Sun Light Intensity |

SetSunScaleModerate
Sets the Sun Scale
Sky.SetSunScale(radius)
Paramètres
| Name | Type | Description |
|---|---|---|
radius | float | The new Sun Scale |
Moonstatic functions

SetMoonGlowIntensityModerate
Sets the Moon Glow Intensity
Sky.SetMoonGlowIntensity(glow_intensity)
Paramètres
| Name | Type | Description |
|---|---|---|
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)
Paramètres
| Name | Type | Description |
|---|---|---|
color | Color | The new Moon Light Color |

SetMoonLightIntensityModerate
Sets the Moon Light Intensity
Sky.SetMoonLightIntensity(intensity)
Paramètres
| Name | Type | Description |
|---|---|---|
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)
Paramètres
| Name | Type | Description |
|---|---|---|
color | Color | The new Moon Material Color |

SetMoonPhaseModerate
Sets the Moon Phase, from new moon to full moon and back
Sky.SetMoonPhase(phase)
Paramètres
| Name | Type | Description |
|---|---|---|
phase | float | Ranges from 0-30 |

SetMoonScaleModerate
Sets the Moon Scale
Sky.SetMoonScale(scale)
Paramètres
| Name | Type | Description |
|---|---|---|
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)
Paramètres
| Name | Type | Description |
|---|---|---|
texture | Image Path | The new Moon Texture |

SetMoonTextureRotationModerate
Sets the Moon Texture Rotation
Sky.SetMoonTextureRotation(rotation)
Paramètres
| Name | Type | Description |
|---|---|---|
rotation | float | The new Moon Texture Rotation |

SetMoonVerticalOffsetModerate
Sets the Moon Vertical Offset
Sky.SetMoonVerticalOffset(offset)
Paramètres
| Name | Type | Description |
|---|---|---|
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?)
Paramètres
| Name | Type | Description |
|---|---|---|
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 Par défaut 0.0 |
See also GetTimeOfDay.
🚀 Events
This class doesn't have own events.


