Constructor
Light.Default Constructor
Syntax
Light(location, rotation = Rotator(0, 0, 0), color = Color(1, 1, 1), light_type = LightType.Point, intensity = 30, attenuation_radius = 250, cone_angle = 44, inner_cone_angle_percent = 0, max_draw_distance = 10000, use_inverse_squared_falloff = true, cast_shadows = true, visible = true, source_radius = 2, spawn_mode = SpawnMode.Immediate)
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
location
|
Vector | — | — |
rotation
optional
|
Rotator | Rotator(0, 0, 0) |
Relevant only for Rect and Spot LightTypes |
color
optional
|
Color | Color(1, 1, 1) |
— |
light_type
optional
|
LightType | LightType.Point |
— |
intensity
optional
|
float | 30 |
— |
attenuation_radius
optional
|
float | 250 |
— |
cone_angle
optional
|
float | 44 |
Relevant only for Spot LightType |
inner_cone_angle_percent
optional
|
float | 0 |
Inner Cone Angle Percent (Relevant only for Spot LightType) (0-1) |
max_draw_distance
optional
|
float | 10000 |
Max Draw Distance (Good for performance) - 0 for infinite |
use_inverse_squared_falloff
optional
|
boolean | 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) |
cast_shadows
optional
|
boolean | true |
— |
visible
optional
|
boolean | true |
— |
source_radius
optional
|
float | 2 |
Radius of light source shape. (Spot and Point types only) |
spawn_mode
optional
|
SpawnMode | SpawnMode.Immediate |
Pass <code>SpawnMode.AfterConstructor</code> or <code>SpawnMode.Manual</code> to avoid immediately sending the entity to clients and improve performance when you want to configure it by setting several configs. Must call <code>FinishSpawn()</code> after all |