# Triggering Multiple Actions via Single Button

{% hint style="info" %}
Main goal of this section is changing state of Character Blueprint, load a level with Level Streaming and change the color of Spotlight Control blueprint **simultaneously with a single click**.
{% endhint %}

{% hint style="info" %}
In this section, we will be utilizing **MainLevel** map of the **RealityExample**, the project shipped with Reality 5.3 SP4.&#x20;
{% endhint %}

It is possible to trigger multiple actions with a single button.

### Preparation

* Launch the RealityExample project.&#x20;

<div align="left"><figure><img src="https://content.gitbook.com/content/oKRkWKIoT5UAB0ERhlgD/blobs/MXTGu5LNafq4keRVtIdb/image.png" alt=""><figcaption><p>Example Node Tree</p></figcaption></figure></div>

* Create a node tree and activate the [APM](https://zerodensitydocumentation.gitbook.io/docs/reality-5.4/reality-5.4/user-guide/nodegraph-actions/nodegraph/advanced-preview-monitor), as shown in the image above.
* Change the camera angle to a suitable position to observe changes by using [GamePad](https://zerodensitydocumentation.gitbook.io/docs/reality-5.4/reality-5.4/user-guide/nodegraph-actions/nodegraph/operating-nodegraph/gamepad) feature.

### Creating Actions

<div align="left"><figure><img src="https://content.gitbook.com/content/oKRkWKIoT5UAB0ERhlgD/blobs/KC6UOVjsqZIrP4OOjGJv/Blueprints%20in%20Reality%20Hub.jpg" alt=""><figcaption><p>Blueprints in Reality Hub</p></figcaption></figure></div>

* Create a new Action, rename it to something like Play All.
* Select the <mark style="color:yellow;">**`UE5`**</mark> node, go to [Node Details Panel](https://zerodensitydocumentation.gitbook.io/docs/reality-5.4/reality-5.4/user-guide/nodegraph-actions/nodegraph/node-details-panel).
* Expand the **UE5** folder, then go to **Blueprints** > and select the **BP\_LevelStreaming**.
* Go to [Properties](https://zerodensitydocumentation.gitbook.io/docs/reality-5.4/reality-5.4/user-guide/nodegraph-actions/nodegraph/node-details-panel/property) panel, expand the **Default**.
* Click on the [Add Timeline](https://zerodensitydocumentation.gitbook.io/docs/reality-5.4/reality-5.4/user-guide/nodegraph/node-details-panel/node-property-toolset#add-timeline) button of the <mark style="color:red;">**`Load Level`**</mark> property, as illustrated above.

<div align="left"><figure><img src="https://content.gitbook.com/content/oKRkWKIoT5UAB0ERhlgD/blobs/c4C3pG1fvwcYkYgBdN8j/Blueprints-in-Reality-Hub-II.jpg" alt=""><figcaption><p>Blueprints in Reality Hub</p></figcaption></figure></div>

* By inheriting the previous method, add the <mark style="color:red;">**`Chane State`**</mark> property of the Character Blueprint into the timeline, as shown in the image above.

<div align="left"><figure><img src="https://content.gitbook.com/content/oKRkWKIoT5UAB0ERhlgD/blobs/ffM9v42RjtkPXI9KUYIi/Spotlight%20Blueprint.jpg" alt=""><figcaption><p>Spotlight Blueprint</p></figcaption></figure></div>

* Add the <mark style="color:red;">**`Lightcolor&intensity`**</mark> property of the BP\_Spotlight into the timeline, as shown in the image above.

<div align="left"><figure><img src="https://content.gitbook.com/content/oKRkWKIoT5UAB0ERhlgD/blobs/ib64bU6Y0II9ERuL21P6/image.png" alt=""><figcaption><p>Action Timeline</p></figcaption></figure></div>

We added Load Level, Change State and Light Color & Intensity properties to the Action Timeline, as illustrated above.&#x20;

### Animation

<div align="left"><figure><img src="https://content.gitbook.com/content/oKRkWKIoT5UAB0ERhlgD/blobs/ozbwvbhdDljCPiJwXBDL/image.png" alt=""><figcaption><p>Adding Keyframes</p></figcaption></figure></div>

* Go to first frame and add keyframe to each property.
* Go to second 2, change the Blue value of Lightcolor\&intensity from 0.500 to 5.000&#x20;
* Add a keyframe to Light Color & Intensity, change its interpolation type to EaseInOut, as illustrated above.
* Save the action.

### Reversing Animation

<div align="left"><figure><img src="https://content.gitbook.com/content/oKRkWKIoT5UAB0ERhlgD/blobs/0J8S75QdLbuuEtOiQsGl/image.png" alt=""><figcaption><p>Reversing Animation</p></figcaption></figure></div>

* Create a new Action, rename it to something like Stop All.
* Add Unload Level, Change State and Lightcolor\&intensity properties to the Action Timeline.
* Go to first frame and add keyframe to each property.
* Go to second 2, change the **Blue** value of **Lightcolor\&intensity** from 5.000 to 0.500.
* Add a keyframe to **Lightcolor\&intensity**, change its interpolation type to **EaseInOut**.
* Save the action.

### Creating Template Form

<div align="left"><figure><img src="https://content.gitbook.com/content/oKRkWKIoT5UAB0ERhlgD/blobs/T6EUjYz4eB1pSZeVus4P/image.png" alt=""><figcaption><p>Template Form</p></figcaption></figure></div>

* Activate the Form Builder and create a new template form.
* Go to the first Action, click & hold your left mouse button on the [Action Play](https://zerodensitydocumentation.gitbook.io/docs/reality-5.4/reality-5.4/user-guide/nodegraph-actions/actions/action-timeline-interface) button, drag & drop it into [Form Area](https://zerodensitydocumentation.gitbook.io/docs/reality-5.4/reality-5.4/user-guide/nodegraph-actions/form-builder/form-builder-interface).
* Repeat the same procedure for the second action.&#x20;
* Save the Template Form, as illustrated above. &#x20;

<div align="left"><figure><img src="https://content.gitbook.com/content/oKRkWKIoT5UAB0ERhlgD/blobs/03Cs4LmpjrD5aPwgxvzN/image.png" alt=""><figcaption><p>Playout Module</p></figcaption></figure></div>

* Activate the [Playout](https://zerodensitydocumentation.gitbook.io/docs/reality-5.4/reality-5.4/user-guide/playout) module, select your template from [Playout Template Form Area](https://zerodensitydocumentation.gitbook.io/docs/reality-5.4/reality-5.4/playout#interface)
* Click on the buttons and check the results via APM.
