User Tools

Site Tools


set_entity_light_enabled

This is an old revision of the document!


Set Entity Light Enabled


Enables or disables the light attached to the specified entity (with the assumption that the entity is a light source).

Signature:

set_entity_light_enabled(entity, enabled)
ArgumentDescriptionTypeRequired
entityEntity that will have its light enabled or disabled.EntityYes
enabledDetermines the light's state (on or off).BooleanYes

If you'd like to change the color of the entity's light instead of toggling it on or off, see the related Set Entity Light Color function.

Example:

set_entity_light_enabled(entity["lamp"], false)

Results: The entity with an ID of “lamp” will have its light disabled (i.e. it will be turned off and no longer cast light until turned on again).

Use the Set Entity Light Enabled function to toggle a room's light on and off when the player interacts with a switch or button.

Editor Node:

Visual Demo:

set_entity_light_enabled.1521218918.txt.gz · Last modified: 2018/03/16 09:48 by justin