# The Light Switch

Add another layer of realism and interactivity to your scenes with the BP\_LightingSwitch. This versatile actor allows the user to turn lights on and off in real-time, and can even function as a self-illuminating light fixture itself.

**Key Features**

* **Dual-Functionality:** Use it as a traditional switch to control other lights, or as an interactive light source itself.
* **Control Multiple Lights:** A single switch can control one or many lights simultaneously.
* **Material Control:** Automatically changes the material of the light source mesh to simulate "on" and "off" states.
* **Supports Standard Light Types:** Works seamlessly with Point Lights, Spot Lights, and Rect Lights.
* **Easy Setup:** Simply drag, drop, and link your lights through the Details panel.

***

#### **Setup & Workflow**

The setup process depends on how you want to use the actor.

**Case 1: Using it as a Traditional Light Switch**

This is the most common use case, where you interact with the switch to turn on/off other lights in the level.

1. **Place the Actor:** Drag and drop the BP\_LightingSwitch actor into your level and position it on a wall.
2. **Configure the Details Panel:** Select the actor to see its properties.

<figure><img src="/files/MhX35MsgHPBl128Z4fWs" alt=""><figcaption></figcaption></figure>

* **Are You Using Switch:** ✅ **Check this box (true).** This tells the actor it is functioning as a remote control for other lights.
* **Light Actor Section:**
  * In the **Light Setup** category, find the light type you want to control (e.g., Spot Lights).
  * Click the **+** icon on the **Select Spot Lights** array to add slots.
  * Use the eyedropper tool or dropdown to assign all the light actors in your level that this switch should control.
  * Set the **New Intensity** to the desired brightness for the "On" state.
* **Configure Section (For Emissive Materials):**
  * You can also make the light fixture's material glow when the light is on.
  * In the **Select Static Mesh** array, add a slot and select the static mesh actor of your light fixture (e.g., the spotlight model).
  * **Material Slot Index:** Specify which material slot on that mesh should change (e.g., 1 for the emissive part).
  * **Light Off Material:** Assign the material that should be used when the light is OFF. The "On" material is handled automatically by the plugin.

***

* **Case 2: Using the Switch Itself as a Light Source**

  Use this method if you want an object (like a table lamp or a wall sconce) to be interactive, where clicking the object itself turns it on and off.

  1. **Place the Actor:** Drag and drop the BP\_LightingSwitch into your level.
  2. **Replace the Mesh:** In the actor's hierarchy, select the **SwitchBoard** component and replace its default static mesh with your light fixture model (e.g., a table lamp mesh).
  3. **Configure the Details Panel:**
     * **Are You Using Switch:** 🔲 **Uncheck this box (false).** This tells the actor that it is the light source itself, not a remote switch.
     * **Light Actor Section:** Link the light components (Point Light, Spot Light) that are part of your light fixture here, just like in Case 1.
     * **Configure Section:**
       * **Select Static Mesh array:** Leave this **empty**. Since the actor itself is the light, you don't need to reference external meshes.
       * **Material Slot Index:** Specify which material slot on your **new SwitchBoard mesh** should have the on/off effect.
       * **Light Off Material:** Assign the material for the "Off" state.

  This dual-functionality makes the BP\_LightingSwitch an incredibly flexible tool for adding all types of lighting interactivity to your

***

#### **Runtime Interaction**

Once configured, simply walk up to the switch in-game and interact with it (e.g., by pressing the 'F' key in PC mode or using a controller button in VR). This will toggle all the linked lights on and off.

**Best Practices & Tips**

* **Room Control:** Use one BP\_LightingSwitch to control all the lights in a single room (e.g., all the spotlights in a kitchen).
* **Custom Meshes:** The BP\_LightingSwitch is made of several static mesh components (like SwitchBoard, Switch). You can easily replace these with your own custom mesh models to match the style of your scene. Simply select the component in the actor's hierarchy and change its Static Mesh property.


---

# Agent Instructions: 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:

```
GET https://shikorviz.gitbook.io/shikordriftxr/the-light-switch.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
