π‘ Light
A Light represents a Lighting source.
info
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 π.
Usageβ
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?
)
Constructor Parametersβ
Type | Name | Default | Description |
---|---|---|---|
Vector | location | Vector(0, 0, 0) | |
Rotator | rotation | Rotator(0, 0, 0) | Relevant only for Rect and Spot LightTypes |
Color | color | Color(1, 1, 1) | |
LightType | light_type | LightType.Point | |
number | intensity | 30 | |
number | attenuation_radius | 250 | |
number | cone_angle | 44 | Relevant only for Spot LightType |
number | inner_cone_angle_percent | 0 | Inner Cone Angle Percent (Relevant only for Spot LightType) (0-1) |
number | 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 | |
boolean | visible | true |
Functionsβ
Inherited Actor Functions
Returns | Name | Description | |
---|---|---|---|
AddImpulse | Applies a Force in world space to this Actor | ||
AttachTo | Attaches this Actor to another Actor | ||
Destroy | Destroys this Actor | ||
Detach | Detaches this Actor if attached | ||
SetCollision | Sets this Actor's collision type | ||
SetForce | Adds a permanent force to this Actor | ||
SetGravityEnabled | Sets whether gravity is enabled on this Actor | ||
![]() | SetVisibility | Sets the Actor visibility | |
SetHighlightEnabled | Sets whether the highlight is enabled on this Actor, and which highlight index to use | ||
SetOutlineEnabled | Sets whether the outline is enabled on this Actor, and which outline index to use | ||
SetLifeSpan | Sets the time (in seconds) before this Actor is destroyed | ||
SetLocation | Sets this Actor's location in the game world | ||
SetNetworkAuthority | Sets the Player this Actor will have its physics calculated on Network Authority | ||
SetRelativeLocation | Sets this Actor's relative location in local space | ||
SetRelativeRotation | Sets this Actor's relative rotation in local space | ||
SetRotation | Sets this Actor's rotation in the game world | ||
SetScale | Sets this Actor's scale | ||
![]() | SetValue | Sets a value in this Actor, which can be accessed by any package | |
TranslateTo | Smoothly moves this Actor to the specified location | ||
RotateTo | Smoothly rotates this Actor to the specified angle | ||
boolean | HasNetworkAuthority | Gets if the LocalPlayer is currently the Network Authority of this Actor | |
boolean | HasAuthority | Gets if this Actor was spawned by the client side | |
![]() | boolean | IsBeingDestroyed | Gets if this Actor is being destroyed |
![]() | boolean | IsGravityEnabled | Gets whether gravity is enabled on this Actor |
![]() | boolean | IsVisible | Gets whether this actor is Visible or not |
![]() | boolean | IsInWater | Gets if this Actor is in water |
![]() | boolean | IsNetworkDistributed | Gets if this Actor is currently Network Distributed |
![]() | boolean | IsValid | Returns if this Actor is valid (i.e. not destroyed) |
![]() | table | GetAttachedEntities | Gets all Actors attached to this Actor |
![]() | any | GetAttachedTo | Gets the Actor this Actor is attached to |
table | GetBounds | Gets this Actor's bounds | |
![]() | number | GetCollision | Gets this Actor's collision type |
![]() | number | GetID | Gets the universal network ID of this Actor |
![]() | Vector | GetLocation | Gets this Actor's location in the game world |
![]() | Rotator | GetRotation | Gets this Actor's angle in the game world |
![]() | Vector | GetForce | Gets this Actor's scale |
![]() | Vector | GetScale | Gets this Actor's scale |
![]() | string | GetType | Gets the type of this Actor |
![]() | any | GetValue | Gets a value stored on this Actor at the given key |
![]() | Vector | GetVelocity | Returns this Actor's current velocity |
string | AddActorTag | Adds an Unreal Actor Tag to this Actor | |
string | RemoveActorTag` | Remove an Unreal Actor Tag from this Actor | |
table | GetActorTags | Gets all Unreal Actor Tags from this Actor | |
![]() | function | Subscribe | Subscribes to an Event |
![]() | Unsubscribe | Unsubscribes from an Event |
Returns | Name | Description | |
---|---|---|---|
![]() | SetColor | Sets the light color | |
![]() | SetTextureLightProfile | Sets the light texture profile | |
![]() | SetEnabled | Enables/Disables the light | |
![]() | SetCastShadows | Enables/Disables the shadows | |
![]() | SetIntensity | Sets the intensity | |
![]() | SetAttenuationRadius | Sets the Attenuation Radius | |
![]() | boolean | IsEnabled | |
![]() | boolean | GetCastShadows | |
![]() | number | GetIntensity | |
![]() | number | GetAttenuationRadius | |
![]() | Color | GetColor |

SetColor
β
Sets the light color
my_light:SetColor(color)
Type | Parameter | Default Value | Description |
---|---|---|---|
Color | color | The light color |

SetTextureLightProfile
β
Sets the light Texture Profile
my_light:SetTextureLightProfile(light_profile)
Type | Parameter | Default Value | Description |
---|---|---|---|
LightProfile | light_profile | The Light Profile to use |

SetEnabled
β
my_light:SetEnabled(is_enabled)
Type | Parameter | Default Value | Description |
---|---|---|---|
number | is_enabled |

SetCastShadows
β
my_light:SetCastShadows(is_shadows_enabled)
Type | Parameter | Default Value | Description |
---|---|---|---|
number | is_shadows_enabled |

SetIntensity
β
my_light:SetIntensity(intensity)
Type | Parameter | Default Value | Description |
---|---|---|---|
number | intensity |

SetAttenuationRadius
β
my_light:SetAttenuationRadius(attenuation_radius)
Type | Parameter | Default Value | Description |
---|---|---|---|
number | attenuation_radius |
Eventsβ
Inherited Actor Events
Name | Description | |
---|---|---|
Destroy | Triggered when an Actor is destroyed | |
Spawn | Triggered when an Actor is spawned/created | |
ValueChange | Triggered when an Actor has a value changed with :SetValue() |
Light Profilesβ
Light Profiles are texture files which describes a light's distribution from a light source using real world measured data.
tip
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.