> For the complete documentation index, see [llms.txt](https://profpivec.gitbook.io/documentation-and-tutorials/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://profpivec.gitbook.io/documentation-and-tutorials/game-creator/action-pack-3-for-game-creator/examples/example-2-light-control.md).

# Example 2 - Light Control

![](/files/-MINzEIUKiV5H3Fplfcq)

Our lighting example uses many Lights and we have set triggers to control them with Actions.&#x20;

**Trigger On Start**

We have two of these so they execute simultaneously. The Actions for the first one, hide the cursor, add a player flashlight, and toggle the flash light off.

The second set of Actions point a spot light at the player and set it to follow the player for 20 seconds before stopping the follow task.

**Trigger F Key**

This trigger simply toggles the attached flashlight on and off. The flashlight that was attached on start, can be configured to be attached to any body part, the colour, intensity and range can be set, and using a cookie, the light texture can also be changed. We have included 3 sample cookies in this module.

![](/files/sHrvhM9FyTUcgl0TTClo)

**Trigger 1 Key**

Changes the light colour of three lights to a random colour and then restarts the Action. This provides an interesting disco effect.

**Trigger 2 Key**

Changes the light intensity of three lights to a random setting with fading and then restarts the Action.

**Trigger 3 Key & On Player Exit/Enter Triggers**

There are two triggers for the player to enter and exit and this changes the colour of the light shining on the player. Trigger 3 key will shrink and enlarge these colliders, and repeat continuously. This is used inconjunct ion with changing the spotlight angle, and provides a very useful effect.&#x20;

**Trigger 4 Key**

The associated Action flickers a light intensity. Min/Max sliders are provided to set the light intensity and flicker time, and a variable or slider will set the overall time for the flicker.

![](/files/f7eUAYbKbZHHdchkb4X4)
