# Quick Start

{% hint style="info" %}
Before proceeding with the next steps, please read the instructions in the "[General Settings](/magic-lightmap-switcher/getting-started/general-settings.md)" section. This is a necessary step before using the plugin.
{% endhint %}

## 1. Adding An Instance

Go to **Magic Lightmap Switcher** ➞ **Examples** ➞ **Scenes** folder and open the **Quick Start** scene.

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

Go to the editor menu **Tools** ➞ **Magic Tools** ➞ **Magic Lightmap Switcher** ➞ **MLS Manager**

After selecting a menu item, the dockable [**MLS Manager**](/magic-lightmap-switcher/system-components/mls-manager-window.md) window will open. You can move it to a place convenient for you.

{% hint style="info" %}
Scene must contain an instance of the **Magic Lightmap Switcher**. This is necessary for the plugin to process scene objects.
{% endhint %}

![](/files/-MW4oi9SzoBiDnah3Xb8)

Click the "**Add Instance**" button, the **Magic Lightmap Switcher** object will be added to the scene in the "**Magic Tools**" group of objects (if there is no such object on the scene, it will be automatically created)

The manager window will look like this.

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

## 2. Creating Presets

Now you can prepare some lighting presets for your scene and save it. Click the "**Create New\..."** button to create a new preset. The preset manager window will open automatically.

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

{% hint style="info" %}
You can name the presets whatever you like. These names will then be used to display the saved lightmaps.
{% endhint %}

Click the **"Start Recording"** button. Then select the light source on the scene (Directional LIght) and change the Transform component to it.

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

Change the **Rotation** values ​​like this: **X**: 20; **Y**: -30; **Z**: 0

The settings will be automatically saved. Now press the **"Duplicate And Edit"** button - the preset will be duplicated. Press **"Start Recording"** again.

Change the **Rotation** values ​​like this: **X**: 20; **Y**: -90; **Z**: 0

Repeat the action and change the values ​​like this: **X**: 20; **Y**: -150; **Z**: 0

Now you have three presets, you can switch between them and edit them.

<figure><img src="/files/5COvcWTN0VGbQyRiBu5V" alt=""><figcaption></figcaption></figure>

## 3. Baking

Change the "**Storing Mode**" to "**Queue**", check the "**Create Lightmap Scenario**" option and click the "**Bake and And Store Lightmaps Queue**" button. This will start the automatic process of baking and storing the lightmaps for all added (and checked) presets.

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

When baking is complete, all saved lightmaps will be displayed in the manager window, and the scene will be lit by the first stored lightmap.

<figure><img src="/files/4J5e6KWZ8Z12HEes5M7x" alt=""><figcaption></figcaption></figure>

## 4. Testing The Scenario

{% hint style="info" %}
**Lightmap Scenario** will be created automatically only if you have checked the "**Create Lightmap Scenario**" option, if the option is not checked, then you need to do it [manually](/magic-lightmap-switcher/using/creating-lighting-scenario.md).
{% endhint %}

### 4.1 Lightmap Switching

You can switch between baked lightmaps. To test this, click one of the "**Load**" buttons in the "**Blendable Lightmaps Queue**".

![](/files/-MiwX-GNFqntCt1dZ1t6)

After completing the setup, you can start switching lightmaps directly in the editor, however, this will not work in play mode, since this requires a call to a special API. You can call this API according to your own rules, however, to simplify the example, a simple script was created that is attached to the "**Runtime Switching (0-2)**" objects in the "**Game Logic**" object.

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

This script calls the Switching API and contains two options - "**Lighting Scenario**" and "**Lightmap Index**". Using the Unity selection window, select the appropriate scenario for script. The name of the scenario created for a particular scene begins with the name of this scene, for example, for **Quick Start** scen&#x65;**,** this will be the scenario **Quick Start\_New Lightmap Scenario\_0**.

Assign a lighting scenario to all three objects.

![](/files/-MiwgAL8eh0kgDYjIsDF)

You can now test switching lighting maps in play mode. Disable the "**Runtime Blending**" object as it is not configured and go to paly mode.&#x20;

Move the Cube object along the **Z** axis. You will see the lightmaps switching.

<figure><img src="/files/3BWh951yerl2D6huM4qi" alt=""><figcaption></figcaption></figure>

### 4.2. Lightmap Blending

To check that everything is working correctly, switch to the **Switching/Blending** tab in the manager window. The plugin automatically created a default **Lightmap Scenario** for you and added all saved lightmaps to it.

<figure><img src="/files/7ABrrur0VD5gSf2WsknZ" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
Note! Reflection Blending Range and Lightmap Blending Range are important, these ranges should not be zero. Read more about how it works [here](/magic-lightmap-switcher/system-components/mls-manager-window.md#blending-configurator).
{% endhint %}

Move the **Global Blend** slider. You should see the lighting data blend smoothly in real time.

After completing the setup, you can start switching and blending lightmaps directly in the editor, however, this will not work in play mode, since this requires a call to a special API. You can call this API according to your own rules, however, to simplify the example, a simple script was created that is attached to the "**Runtime Blending**" object in the "**Game Logic**" object.

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

This script calls the Cyclic Blend API and contains two options - "**Lighting Scenario**" and "**Blending Length**". Using the Unity selection window, select the appropriate scenario for script. The name of the scenario created for a particular scene begins with the name of this scene, for example, for **Quick Start** scen&#x65;**,** this will be the scenario **Quick Start\_New Lightmap Scenario\_0**.

![](/files/-MW4xKrY2oX-rcYkycYB)

Now you can start playing. Once launched, the script will automatically run.

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


---

# 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://motiongamesstudio.gitbook.io/magic-lightmap-switcher/getting-started/quick-start-1.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.
