Light: distance

distance
  • gets/sets the maximum distance the light illuminates.

Type:

  • float number

Range:

  • 0.00 to 1000.00 Blender Units
Note:
  • Point, Spot and Area lights.
Sample Code

################## get the light's max distance
 
# import bge
import bge

# get current scene
scene = bge.logic.getCurrentScene()

# get a list of the lights in the scene
lightList = scene.lights

# get point light named TableLamp
light = lightList["TableLamp"]

# get point light's max distance
dist = light.distance

Sample Code

################## set the light's max distance
 
# import bge
import bge

# get current scene
scene = bge.logic.getCurrentScene()

# get a list of the lights in the scene
lightList = scene.lights

# get point light named TableLamp
light = lightList["TableLamp"]

# set point light's max distance
light.distance = 5.0