π‘ Light
A Light represents a Lighting source.
π Examplesβ
local my_light = Light(
Vector(-152, 245, 115),
Rotator(0, 90, 90), -- Relevant only for Rect and Spot light types
Color(1, 0, 0), -- Red Tint
LightType.Point, -- Point Light type
100, -- Intensity
250, -- Attenuation Radius
44, -- Cone Angle (Relevant only for Spot light type)
0, -- Inner Cone Angle Percent (Relevant only for Spot light type)
5000, -- Max Draw Distance (Good for performance - 0 for infinite)
true, -- Whether to use physically based inverse squared distance falloff, where Attenuation Radius is only clamping the light's contribution. (Spot and Point types only)
true, -- Cast Shadows?
true -- Enabled?
)
π Constructorsβ
Default Constructor
No description provided
local my_light = Light(location, rotation?, color?, light_type?, intensity?, attenuation_radius?, cone_angle?, inner_cone_angle_percent?, max_daw_distance?, use_inverse_squared_falloff?, cast_shadows?, visible?)
Type | Name | Default | Description |
---|---|---|---|
Vector | location | Required parameter | No description provided |
Rotator | rotation | Rotator(0, 0, 0) | Relevant only for Rect and Spot LightTypes |
Color | color | Color(1, 1, 1) | No description provided |
LightType | light_type | LightType.Point | No description provided |
float | intensity | 30 | No description provided |
float | attenuation_radius | 250 | No description provided |
float | cone_angle | 44 | Relevant only for Spot LightType |
float | inner_cone_angle_percent | 0 | Inner Cone Angle Percent (Relevant only for Spot LightType) (0-1) |
float | max_daw_distance | 5000 | Max Draw Distance (Good for performance) - 0 for infinite |
boolean | use_inverse_squared_falloff | true | Whether to use physically based inverse squared distance falloff, where Attenuation Radius is only clamping the light's contribution. (Spot and Point types only) |
boolean | cast_shadows | true | No description provided |
boolean | visible | true | No description provided |
nanos world provides 3 types of lights: Spot, Point and Rect. All lights are Dynamic and because of that, very expensive! Keep that in mind before spawning 1000 lights π.
πΏ Static Functionsβ
Inherited Entity Static Functions
This class doesn't have own static functions.
π¦ Functionsβ
Inherited Entity Functions
Inherited Actor Functions
Returns | Name | Description | |
---|---|---|---|
![]() | float | GetAttenuationRadius | No description provided |
![]() | boolean | GetCastShadows | No description provided |
![]() | Color | GetColor | No description provided |
![]() | float | GetIntensity | No description provided |
![]() | SetAttenuationRadius | No description provided | |
![]() | SetCastShadows | No description provided | |
![]() | SetColor | Sets the light color | |
![]() | SetIntensity | No description provided | |
![]() | SetTextureLightProfile | Sets the light Texture Profile |

GetAttenuationRadius
β Returns float.
local ret = my_light:GetAttenuationRadius()
See also SetAttenuationRadius.

GetCastShadows
β Returns boolean.
local ret = my_light:GetCastShadows()
See also SetCastShadows.

GetColor
β Returns Color.
local ret = my_light:GetColor()
See also SetColor.

GetIntensity
β Returns float.
local ret = my_light:GetIntensity()
See also SetIntensity.

SetAttenuationRadius
my_light:SetAttenuationRadius(attenuation_radius)
Type | Parameter | Default | Description |
---|---|---|---|
float | attenuation_radius | Required parameter | No description provided |
See also GetAttenuationRadius.

SetCastShadows
my_light:SetCastShadows(is_shadows_enabled)
Type | Parameter | Default | Description |
---|---|---|---|
boolean | is_shadows_enabled | Required parameter | No description provided |
See also GetCastShadows.

SetColor
Sets the light color
my_light:SetColor(color)
Type | Parameter | Default | Description |
---|---|---|---|
Color | color | Required parameter | The light color |
See also GetColor.

SetIntensity
my_light:SetIntensity(intensity)
Type | Parameter | Default | Description |
---|---|---|---|
float | intensity | Required parameter | No description provided |
See also GetIntensity.

SetTextureLightProfile
Sets the light Texture Profile
my_light:SetTextureLightProfile(light_profile)
Type | Parameter | Default | Description |
---|---|---|---|
LightProfile | light_profile | Required parameter | The Light Profile to use |
See also π‘ Light Profiles.
π Eventsβ
Inherited Entity Events
Inherited Actor Events
This class doesn't have own events.
π‘ Light Profilesβ
Light Profiles are texture files which describes a light's distribution from a light source using real world measured data.
Please check Unreal Engine Light Profile documentation for more information about Light Profiles!
nanos world provides 50 Light Profiles included in the base game which you can use to enhance your Lights. You can set them using :SetTextureLightProfile()
with the enum LightProfile.