🌅 Sky
Interact with built-in Sky & Weather system.

nanos world intègre nativement Ultra Dynamic Sky, l'un des meilleurs packs d'actifs Unreal Marketplace, il fournit un ciel dynamique et une solution 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
Client/Index.lua
-- Spawns a new Ultra Dynamic Sky actor
Sky.Spawn()
-- Sets the time to 16:30
Sky.SetTimeOfDay(16, 30)
🗿 Fonctions statiques
| Returns | Name | Description | |
|---|---|---|---|
ChangeWeather | Changes the 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 | ||
| integer, integer, integer | GetTimeOfDay | Gets the current time | |
| WeatherType | GetWeather | Gets the current weather | |
| boolean | IsSpawned | Returns if the Ultra Dynamic Sky was spawned | |
Reconstruct | Reconstruct the Ultra Dynamic Sky Actor, forces most of the changes to be applied | ||
SetAnimateTimeOfDay | Sets whether or not to animate the time of day | ||
SetCloudCoverage | The amount of coverage for the cloud layer, from a clear sky to overcast | ||
SetContrast | A simple contrast boost for the sky material. Cannot affect volumetric clouds | ||
SetFog | The fogginess of the scene. The impact this has on fog density is scaled from the Fog Density category | ||
SetMoonAngle | Sets the Moon Angle | ||
SetMoonGlowIntensity | Sets the Moon Glow Intensity | ||
SetMoonLightIntensity | Sets the Moon Light Intensity | ||
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 | ||
SetNightBrightness | Can be used to scale the brightness of the sky and lighting, at night | ||
SetOverallIntensity | The overall brightness of the shader | ||
SetSkyMode | Sets the Sky Mode | ||
SetSunAngle | Sets the Sun Angle | ||
SetSunLightIntensity | Sets the Sun Light Intensity | ||
SetSunScale | Sets the Sun Scale | ||
SetTimeOfDay | Sets the current time | ||
SetVolumetricCloudColor | Sets the Volumetric Cloud Color | ||
| boolean | Spawn | Replaces all Sky/Sun actors with the Ultra Dynamic Sky Actor, to be able to use the functions from this page |
Moderate

ChangeWeather
Changes the Weather
Sky.ChangeWeather(weather, transition_time)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| WeatherType | weather | Required parameter | weather to change |
| float | transition_time | Required parameter | fade time to completely change to new weather |
Moderate

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 LevelSky.DestroyAllSky()
Moderate

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

GetWeather
Gets the current weather
local ret = Sky.GetWeather()
Returns
| Type | Description |
|---|---|
| WeatherType | Current weather |
Optimal

IsSpawned
Returns if the Ultra Dynamic Sky was spawned
local ret = Sky.IsSpawned(including_weather)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| boolean | including_weather | Required parameter | if to check for Weather Actor too |
Returns
| Type | Description |
|---|---|
| boolean | Whether the Ultra Dynamic Sky was spawned |
Slow

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

SetAnimateTimeOfDay
Sets whether or not to animate the time of day
Sky.SetAnimateTimeOfDay(animate, day_length?, night_length?)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| boolean | animate | Required parameter | Whether or not to animate the time of day |
| float or nil | day_length? | 30.0 | The time (in minutes) from sunrise to sunset |
| float or nil | night_length? | 15.0 | The time (in minutes) from sunset to sunrise |
Moderate

SetCloudCoverage
The amount of coverage for the cloud layer, from a clear sky to overcast
Sky.SetCloudCoverage(cloud_coverage)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| float | cloud_coverage | Required parameter | From 0 (clear sky) to 10 (overcast) |
Moderate

SetContrast
A simple contrast boost for the sky material. Cannot affect volumetric clouds
Sky.SetContrast(contrast)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| float | contrast | Required parameter | Contrast multiplier of the sky |
Moderate

SetFog
The fogginess of the scene. The impact this has on fog density is scaled from the Fog Density category
Sky.SetFog(fog_percentage)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| float | fog_percentage | Required parameter | Fog amount, from 0 to 100 |
Moderate

SetMoonAngle
Sets the Moon Angle
Sky.SetMoonAngle(yaw, pitch)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| float | yaw | Required parameter | Yaw angle, in degrees |
| float | pitch | Required parameter | Pitch angle, in degrees |
Moderate

SetMoonGlowIntensity
Sets the Moon Glow Intensity
Sky.SetMoonGlowIntensity(glow_intensity)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| float | glow_intensity | Required parameter | The new Moon Glow Intensity |
Moderate

SetMoonLightIntensity
Sets the Moon Light Intensity
Sky.SetMoonLightIntensity(intensity)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| float | intensity | Required parameter | The new Moon Light Intensity |
Moderate

SetMoonPhase
Sets the Moon Phase, from new moon to full moon and back
Sky.SetMoonPhase(phase)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| float | phase | Required parameter | Ranges from 0-30 |
Moderate

SetMoonScale
Sets the Moon Scale
Sky.SetMoonScale(scale)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| float | scale | Required parameter | The new Moon Scale |
Slow

SetMoonTexture
Sets the Moon Texture
Set it to empty to restore the default. After setting it, you must callSky.Reconstruct()to have it applied properly
Sky.SetMoonTexture(texture)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| Image Path | texture | Required parameter | The new Moon Texture |
Moderate

SetMoonTextureRotation
Sets the Moon Texture Rotation
Sky.SetMoonTextureRotation(rotation)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| float | rotation | Required parameter | The new Moon Texture Rotation |
Moderate

SetMoonVerticalOffset
Sets the Moon Vertical Offset
Sky.SetMoonVerticalOffset(offset)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| float | offset | Required parameter | The new Moon Vertical Offset |
Moderate

SetNightBrightness
Can be used to scale the brightness of the sky and lighting, at night
Sky.SetNightBrightness(brightness)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| float | brightness | Required parameter | Brightness multiplier at night |
Moderate

SetOverallIntensity
The overall brightness of the shader
Sky.SetOverallIntensity(intensity)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| float | intensity | Required parameter | Brightness multiplier of the sky |
Moderate

SetSkyMode
Sets the Sky Mode
After setting it, you must callSky.Reconstruct()to have it applied properly
Sky.SetSkyMode(sky_mode)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| SkyMode | sky_mode | Required parameter | The new Sky Mode |
Moderate

SetSunAngle
Sets the Sun Angle
Sky.SetSunAngle(yaw, pitch)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| float | yaw | Required parameter | Yaw angle, in degrees |
| float | pitch | Required parameter | Pitch angle, in degrees |
Moderate

SetSunLightIntensity
Sets the Sun Light Intensity
Sky.SetSunLightIntensity(intensity)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| float | intensity | Required parameter | The new Sun Light Intensity |
Moderate

SetSunScale
Sets the Sun Scale
Sky.SetSunScale(radius)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| float | radius | Required parameter | The new Sun Scale |
Moderate

SetTimeOfDay
Sets the current time
Sky.SetTimeOfDay(hours, minutes, transition_time?)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| integer | hours | Required parameter | Hour of the day (0-23) |
| integer | minutes | Required parameter | Minutes (0-59) |
| float or nil | transition_time? | 0.0 | Seconds to smoothly transition to the new time, 0 to change immediately |
See also GetTimeOfDay.
Moderate

SetVolumetricCloudColor
Sets the Volumetric Cloud Color
This is only applied ifSetSkyMode(SkyMode.VolumetricClouds)is set
Sky.SetVolumetricCloudColor(color)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| Color | color | Required parameter | The new Volumetric Cloud Color |
Slow

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() automaticallylocal ret = Sky.Spawn(spawn_weather?, find_existing?)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| boolean | spawn_weather? | false | Whether or not to spawn the Weather Actor (to be able to use Weather related methods) |
| boolean | find_existing? | true | Whether or not to try to find existing Sky & Weather Actors spawned in the map, using their references instead |
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 |
🚀 Événements
This class doesn't have own events.


