> 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)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://profpivec.gitbook.io/documentation-and-tutorials/game-creator/action-pack-3-for-game-creator/examples/example-2-light-control.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
