# Entity Enabling & Disabling

***

### EntityDisable

This guide provides instructions for setting up the **EntityDisable** action. In the sample app, once the avatar collides with the gold coin, the gold coin is disabled.

| <img src="https://1140075852-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pMiThqqrBzfvP8uy5am%2Fuploads%2FvUkatAnZcNYLDDMsUHb5%2Fimage.png?alt=media&#x26;token=340afb68-e35c-467e-89e8-c149c4954df9" alt="" data-size="original"> | <img src="https://1140075852-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pMiThqqrBzfvP8uy5am%2Fuploads%2FHxUYnXICKbbHbiQLEVn2%2Fimage.png?alt=media&#x26;token=d088e405-dea3-4895-ac31-a2cb03051352" alt="" data-size="original"> |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| The avatar is not colliding with the gold coin.                                                                                                                                                                                                            | Once the avatar collides with gold coin, the gold coin is disabled.                                                                                                                                                                                        |

In this example, a trigger is created and when triggered, an action disables an object.&#x20;

#### **Create an action that disables an object**

{% stepper %}
{% step %}
**Create the 3D Object that will be disabled**

A. Add 3D object to the scene.

B. The **Collision** component is not required for **EntityDisable** action to work. The **Collision** component is required for the **EntitySubscribeCollisionStart** trigger that will be used in this example.

C. The **Rigidbody** component is not required for the **EntityDisable** action to work. The **Rigidbody** component is required for the **EntitySubscribeCollisionStart** trigger that will be used in this example.

D. Click the **Edit Viverse Extension** button.

<figure><img src="https://1140075852-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pMiThqqrBzfvP8uy5am%2Fuploads%2FtA9DpBl4qMlbapf3pPDY%2Fimage.png?alt=media&#x26;token=8885553d-1723-4e8e-b470-f81f259cb182" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Add the EntityDisable action**

A. In the VIVERSE extension, select the **TriggerAndAction** plugin for the **Select plugins** dropdown.

B. Add a **Trigger** and select **EntitySubscribeCollisionStart**.

C. Add **local-player** to the **tags to filter** field.

D. Add an **Action** and select **EntityDisable.**

<figure><img src="https://1140075852-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pMiThqqrBzfvP8uy5am%2Fuploads%2F6gEXMmjJErzM4h470zuY%2Fimage.png?alt=media&#x26;token=57a34847-7233-4e5b-b206-ba289f7f7b0a" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

### EntityEnableById

This guide provides instructions for setting up the **EntityEnableById** action. In the sample app, once the avatar enters the trigger area, the gold coin is enabled.

| <img src="https://1140075852-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pMiThqqrBzfvP8uy5am%2Fuploads%2FOajebvRxB4z971LPicQd%2Fimage.png?alt=media&#x26;token=f8c40c71-d271-40d5-9472-f3c93a4804fa" alt="" data-size="original"> | <img src="https://1140075852-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pMiThqqrBzfvP8uy5am%2Fuploads%2FubAq5msqZBneP4IarsO4%2Fimage.png?alt=media&#x26;token=68161af7-fcd1-4dab-b9e7-27db2bb2a108" alt="" data-size="original"> |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| When the avatar is outside of the blue trigger area, the gold coin is disabled.                                                                                                                                                                            | When the avatar enters the blue trigger area, the gold coin is enabled.                                                                                                                                                                                    |

In this example, a trigger is created and when triggered, an action enables an object. Any object can be used as a trigger, as long as the object has a collision component. This example uses a 3D box as the trigger area.

#### **Create an action that enables a single object**

{% stepper %}
{% step %}
**Create a trigger area**

A. Create a new **3D Box** entity.

B. The **Collision** component is not required for **EntityDisableById** action to work. The **Collision** component is required for the **EntitySubscribeTriggerEnter** trigger that will be used in this example.

C. Adding a material is optional. A transparent material has been added so that the trigger area is visible in play mode.

D. Click the **Edit Viverse Extension** button.

<figure><img src="https://1140075852-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pMiThqqrBzfvP8uy5am%2Fuploads%2FUlSJlmzIliEc2W5R0VPB%2Fimage.png?alt=media&#x26;token=9cc65dfc-81cd-406a-a68f-3322278819a7" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Add the** *EntityEnableById* **action**

A. In the VIVERSE extension, select the **TriggerAndAction** plugin for the **Select plugins** dropdown.

B. Add a **Trigger** and select **EntitySubscribeTriggerEnter**.

C. Add **local-player** to the **tags to filter** field.

D. Add an **Action** and select **EntityEnableById.**

E. Add an object that will be enabled when the avatar enters the trigger area. The **golden\_coin** entity has been added to the **pick up specify execution entity**. The **golden\_coin** entity has also been disabled by default.

<figure><img src="https://1140075852-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pMiThqqrBzfvP8uy5am%2Fuploads%2FV4dTb171vg3qeXeJztrd%2Fimage.png?alt=media&#x26;token=9c5d6179-b6c4-4b3d-ac49-a5792cd93293" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

### EntityDisableById

This guide provides instructions for setting up the **EntityDisableById** action. In the sample app, once the avatar leaves the trigger area, the gold coin is disabled.

| <img src="https://1140075852-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pMiThqqrBzfvP8uy5am%2Fuploads%2Fyrt30zDIwiORiMVXuJay%2Fimage.png?alt=media&#x26;token=9bf93091-b47e-4d28-919e-86bb8180002f" alt="" data-size="original"> | <img src="https://1140075852-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pMiThqqrBzfvP8uy5am%2Fuploads%2FCStnGj4t5MwKS0WbvdtX%2Fimage.png?alt=media&#x26;token=488ed886-e7cf-4ad7-bca1-b0b594afdfff" alt="" data-size="original"> |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| When the avatar is inside the blue the trigger area, the gold coin is enabled.                                                                                                                                                                             | When the avatar leaves the blue trigger area, the gold coin is disabled.                                                                                                                                                                                   |

In this example, a trigger is created and when triggered, an action disables an object. Any object can be used as a trigger, as long as the object has a collision component. This example uses a 3D box as the trigger area.

#### **Create an action that disables a single object**

{% stepper %}
{% step %}
**Create a trigger area**

A. Create a new **3D Box** entity.

B. The **Collision** component is not required for **EntityDisableById** action to work. The **Collision** component is required for the **EntitySubscribeTriggerLeave** trigger that will be used in this example.

C. Adding a material is optional. A transparent material has been added so that the trigger area is visible in play mode.

<figure><img src="https://1140075852-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pMiThqqrBzfvP8uy5am%2Fuploads%2F3ov9gLYDmgcaNdpNQg7R%2Fimage.png?alt=media&#x26;token=7af27cf0-f52d-48d6-a05e-9a6866b26c83" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Add the** *EntityDisableById* **action**

A. In the VIVERSE extension, select the **TriggerAndAction** plugin for the **Select plugins** dropdown.

B. Add a **Trigger** and select **EntitySubscribeTriggerLeave**.

C. Add **local-player** to the **tags to filter** field.

D. Add an **Action** and select **EntityDisableById.**

E. Add an object that will be disabled when the avatar leaves the trigger area. The **golden\_coin** entity has been added to the **pick up specify execution entity**. The **golden\_coin** entity has also been disabled by default.

<figure><img src="https://1140075852-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pMiThqqrBzfvP8uy5am%2Fuploads%2FnS5YAd3te5EMdaU8ON4E%2Fimage.png?alt=media&#x26;token=901e973a-7285-468e-afc4-d05077a45b0a" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

### EntityEnableByTag

This guide provides instructions for setting up the **EntityEnableByTag** action. In the sample app, once the avatar enters the trigger area, multiple balls are enabled.

| <img src="https://1140075852-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pMiThqqrBzfvP8uy5am%2Fuploads%2Fxb3A2WAwRUNy2qY0NQhx%2Fimage.png?alt=media&#x26;token=df6cd764-5c7d-45d9-8244-ff0ea1e2bfd8" alt="" data-size="original"> | <img src="https://1140075852-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pMiThqqrBzfvP8uy5am%2Fuploads%2FJO6JQXZ0blItg5DpAz53%2Fimage.png?alt=media&#x26;token=775afee2-4740-4116-b153-9f30e91031a1" alt="" data-size="original"> |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| When the avatar is outside the blue trigger area, the balls are disabled.                                                                                                                                                                                  | When the avatar enters the blue trigger area, the balls are enabled.                                                                                                                                                                                       |

In this example, a trigger is created and when triggered, an action enables multiple objects. Any object can be used as a trigger, as long as the object has a collision component. This example uses a 3D box as the trigger area.

#### **Create an action that enables multiple objects**

{% stepper %}
{% step %}
**Create a trigger area**

A. Create a new **3D Box** entity.

B. The **Collision** component is not required for **EntityEnableByTag** action to work. The **Collision** component is required for the **EntitySubscribeTriggerEnter** trigger that will be used in this example.

C. Adding a material is optional. A transparent material has been added so that the trigger area is visible in play mode.

D. Click the **Edit Viverse Extension** button.

<figure><img src="https://1140075852-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pMiThqqrBzfvP8uy5am%2Fuploads%2FjWzximVPIh7IQSpnNrvK%2Fimage.png?alt=media&#x26;token=29e8c49e-99aa-4acf-b5bf-cfffe64eda68" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Add the** *EntityEnableByTag* **action**

A. In the VIVERSE extension, select the **TriggerAndAction** plugin for the **Select plugins** dropdown.

B. Add a **Trigger** and select **EntitySubscribeTriggerEnter**.

C. Add **local-player** to the **tags to filter** field.

D. Add an **Action** and select **EntityEnableByTag.**

E. Create a unique **Tag** and add it to the **enable entity with tag** field. In this example, the **Balls** tag is added.

<figure><img src="https://1140075852-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pMiThqqrBzfvP8uy5am%2Fuploads%2F0dem7ZAb1U43KUYyyMam%2Fimage.png?alt=media&#x26;token=37052fb3-ad0c-46ef-aaae-96849ac6678a" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Add Tag to multiple objects**

A. Multiple objects can be enabled using the **EntityEnableByTag** action. Create multiple objects in the scene.

B. In the **Tags** field, add the same tag from the **enable entity with tag** field. Do this for all of the objects or parents of multiple objects.

<figure><img src="https://1140075852-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pMiThqqrBzfvP8uy5am%2Fuploads%2Fr5VxbuocADA4XgmfdNgA%2Fimage.png?alt=media&#x26;token=d3aa6f63-283f-4131-8dc4-b13f2f99647a" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

### EntityDisableByTag

This guide provides instructions for setting up the **EntityDisableByTag** action. In the sample app, once the avatar leaves the trigger area, multiple balls are disabled.

| <img src="https://1140075852-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pMiThqqrBzfvP8uy5am%2Fuploads%2FjzhSZkdXVhwZ2Pm95oMx%2Fimage.png?alt=media&#x26;token=e4a4095e-32d7-43f6-9137-72b3e4202459" alt="" data-size="original"> | <img src="https://1140075852-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pMiThqqrBzfvP8uy5am%2Fuploads%2FBxNNKpV2rSI6LM8yiese%2Fimage.png?alt=media&#x26;token=205d39f3-5239-40ae-a7a9-7fc04f714ad6" alt="" data-size="original"> |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| When the avatar enters the blue trigger area, the balls are enabled.                                                                                                                                                                                       | When the avatar leaves the blue trigger area, the balls are disabled.                                                                                                                                                                                      |

In this example, a trigger is created and when triggered, an action disables multiple objects. Any object can be used as a trigger, as long as the object has a collision component. This example uses a 3D box as the trigger area.

#### **Create an action that disables multiple objects**

{% stepper %}
{% step %}
**Create a trigger area**

A. Create a new **3D Box** entity.

B. The **Collision** component is not required for **EntityDisableByTag** action to work. The **Collision** component is required for the **EntitySubscribeTriggerLeave** trigger that will be used in this example.

C. Adding a material is optional. A transparent material has been added so that the trigger area is visible in play mode.

Click the **Edit Viverse Extension** button.

<figure><img src="https://1140075852-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pMiThqqrBzfvP8uy5am%2Fuploads%2FI09UCi0WRh30NKN508q8%2Fimage.png?alt=media&#x26;token=0d89db96-0283-4649-9cea-d3e3d9dd1d39" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Add the** *EntityDisableByTag* **action**

A. In the VIVERSE extension, select the **TriggerAndAction** plugin for the **Select plugins** dropdown.

B. Add a **Trigger** and select **EntitySubscribeTriggerLeave**.

C. Add **local-player** to the **tags to filter** field.

D. Add an **Action** and select **EntityDiableByTag.**

E. Create a unique **Tag** and add it to the **enable entity with tag** field. In this example, the **Balls** tag is added.

<figure><img src="https://1140075852-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pMiThqqrBzfvP8uy5am%2Fuploads%2FQUNP6DSBHXxgiaNkOcm6%2Fimage.png?alt=media&#x26;token=e3af4a63-028f-4c7f-8c88-6d8ac4a204ea" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Add** *EntityEnableByTag* **to multiple objects**

A. Multiple objects can be enabled using the **EntityEnableByTag** action. Create multiple objects in the scene.

B. In the **Tags** field, add the same tag from the **enable entity with tag** field to all of the objects or parents of multiple objects.

<figure><img src="https://1140075852-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pMiThqqrBzfvP8uy5am%2Fuploads%2F0bQC13NTdeS5ypr0dljA%2Fimage.png?alt=media&#x26;token=5b538ccb-31d6-4ae7-aeec-73538ef986c1" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

### EntityFadeIn

This guide provides instructions for setting up the **EntityFadeIn** action. In the sample app, once the avatar starts colliding with the red platform, the red platform will fade in.

| <img src="https://1140075852-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pMiThqqrBzfvP8uy5am%2Fuploads%2FeB4cTbS0DgDJOnDOCwKW%2Fimage.png?alt=media&#x26;token=387a9065-c2f7-4de4-8ee8-95cabadcc7dd" alt="" data-size="original"> | <img src="https://1140075852-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pMiThqqrBzfvP8uy5am%2Fuploads%2FKJxqn3F1LkAqXowZPQZw%2Fimage.png?alt=media&#x26;token=bd90c72b-0837-40a0-b6a9-208a9b450b1c" alt="" data-size="original"> |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| The red platform has been faded out and is invisible, but the avatar can still collide with it.                                                                                                                                                            | Once the avatar begins colliding with the invisible red platform, the red platform fades in and is now visible.                                                                                                                                            |

In this example, a trigger is created and when triggered, an action fades in the object it has been added to. Any object can be used as a trigger, as long as the object has a collision component. This example uses a 3D box as the trigger area.

#### **Create an action that fades in an object**

{% stepper %}
{% step %}
**Create the 3D object that will fade in**

A. Add a 3D object to the scene.

B. A **Collision** component is not required for the **EntityFadeIn** action to work. The **Collision** component is required for the **EntitySubscribeCollisionStart** trigger that will be used in this example.

C. A **Rigidbody** component is not required for the **EntityFadeIn** action to work. The **Rigidbody** component is required for the **EntitySubscribeCollisionStart** trigger that will be used in this example.

D. Click the **Edit Viverse Extension** button.

<figure><img src="https://1140075852-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pMiThqqrBzfvP8uy5am%2Fuploads%2FeI8sF2sAFjmh8rt7nkKo%2Fimage.png?alt=media&#x26;token=134b1e09-22e9-4563-8e22-77ffd206556f" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Add the** *EntityFadeIn* **action**

A. In the VIVERSE extension, select the **TriggerAndAction** plugin for the **Select plugins** dropdown.

B. Add a **Trigger** and select **EntitySubscribeCollisionStart**.

C. Add **local-player** to the **tags to filter** field.

D. Add an **Action** and select **EntityFadeIn**. To customize how long before the fade begins or duration of the fade, update **delay in ms** and **duration in ms** fields.

<figure><img src="https://1140075852-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pMiThqqrBzfvP8uy5am%2Fuploads%2F5xBjPpo6AiA25qshyvUK%2Fimage.png?alt=media&#x26;token=dc3e4ccc-d008-451b-86fc-7ccb953c26c2" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

### EntityFadeOut

This guide provides instructions for setting up the **EntityFadeOut** action. In the sample app, once the avatar stops colliding with the red platform, the red platform will fade out.

| <img src="https://1140075852-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pMiThqqrBzfvP8uy5am%2Fuploads%2FdMq1fCNAStl32Rj0zfDa%2Fimage.png?alt=media&#x26;token=939daa69-5c19-4ed1-8021-0bc335bcfcfd" alt="" data-size="original"> | <img src="https://1140075852-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pMiThqqrBzfvP8uy5am%2Fuploads%2FC6XSXDD9ycSLO7CHM0sN%2Fimage.png?alt=media&#x26;token=43830868-93fb-49ee-9371-2c6daab71a44" alt="" data-size="original"> |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| The avatar is colliding with the red platform.                                                                                                                                                                                                             | Once the avatar stops colliding with the red platform, the red platform begins to fade out.                                                                                                                                                                |

In this example, a trigger is created and when triggered, an action fades an object. Any object can be used as a trigger, as long as the object has a collision component.

#### Create an action that fades out an object

{% stepper %}
{% step %}
**Create the 3D object that will fade out**

A. Add a 3D object to the scene.

B. A **Collision** component is not required for the **EntityFadeOut** action to work. The **Collision** component is required for the **EntitySubscribeCollisionEnd** trigger that will be used in this example.

C. A **Rigidbody** component is not required for the **EntityFadeOut** action to work. The **Rigidbody** component is required for the **EntitySubscribeCollisionEnd** trigger that will be used in this example.

D. Click the **Edit Viverse Extension** button.

<figure><img src="https://1140075852-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pMiThqqrBzfvP8uy5am%2Fuploads%2FBN5NXbc7EZocALhB7Y9h%2Fimage.png?alt=media&#x26;token=d0b7f6c5-8f4e-4e57-aadc-90c49fbb6da3" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Add the** *EntityFadeOut* **action**

A. In the VIVERSE extension, select the **TriggerAndAction** plugin for the **Select plugins** dropdown.

B. Add a **Trigger** and select **EntitySubscribeCollisionEnd**.

C. Add **local-player** to the **tags to filter** field.

D. Add an **Action** and select **EntityFadeOut**. To customize how long before the fade begins or duration of the fade, update **delay in ms** and **duration in ms** fields.

<figure><img src="https://1140075852-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pMiThqqrBzfvP8uy5am%2Fuploads%2FR2GT7pmur5f0J3FjnMHF%2Fimage.png?alt=media&#x26;token=42765371-8b1f-4909-912e-91028be3af17" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

### EntityToggleEnabled

This guide provides instructions for setting up the **EntityToggleEnabled** action. In the sample app, every time the avatar enters the blue trigger area, a notification is sent to the purple box to toggle it’s enabled state.

<table data-header-hidden data-full-width="false"><thead><tr><th></th><th></th></tr></thead><tbody><tr><td><img src="https://1140075852-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pMiThqqrBzfvP8uy5am%2Fuploads%2FGKHXBos0FKDQ8y30HH0o%2Fimage.png?alt=media&#x26;token=01b54fe7-e6c2-412d-b259-587fceee69b3" alt="" data-size="original"></td><td><img src="https://1140075852-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pMiThqqrBzfvP8uy5am%2Fuploads%2FGAIEL1JRjOPGjEo33Inl%2Fimage.png?alt=media&#x26;token=f5fad32b-7238-4a0a-89db-348efcda8cb3" alt="" data-size="original"></td></tr><tr><td>The purple box is enabled/visible before the avatar enters the blue trigger area.</td><td>Once the avatar enters the blue trigger area, a notification is sent to the purple box to toggle it’s enabled stated. The purple box is disabled.</td></tr><tr><td><img src="https://1140075852-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pMiThqqrBzfvP8uy5am%2Fuploads%2FukRBuFJU5gLnq5jlbu4I%2Fimage.png?alt=media&#x26;token=fa0c2819-be0b-4598-b319-94f489af45e1" alt="" data-size="original"></td><td><img src="https://1140075852-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pMiThqqrBzfvP8uy5am%2Fuploads%2FYkhVlrZFWd2H9mM5nHUq%2Fimage.png?alt=media&#x26;token=124f7929-53e4-43b5-99fd-edcdf1bf500b" alt="" data-size="original"></td></tr><tr><td>The avatar leaves the blue trigger area.</td><td>Once the avatar enters the blue trigger area again, a notification is sent to the purple box to toggle it’s enabled stated. The purple box is enabled again.</td></tr></tbody></table>

In this example, a trigger is created and when the avatar or other objects enter the trigger area, an action sends a notification to toggle another object's enabled state. Any object can be used as a trigger, as long as the object has a collision component.

#### **Create an action that toggles an object's enabled state**

{% stepper %}
{% step %}
**Create a trigger area**

A. Create a new **3D Box** entity.

B. A **Collision** component is not required for the **EntityToggleEnabled** action to work. The **Collision** component is required for the **EntitySubscribeTriggerEnter** trigger that will be used in this example.

C. Adding a material is optional. A transparent material has been added so that the trigger area is visible in play mode.

D. Click the **Edit Viverse Extension** button.

<figure><img src="https://1140075852-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pMiThqqrBzfvP8uy5am%2Fuploads%2F4G1WADzz7a6qzdGkoLp4%2Fimage.png?alt=media&#x26;token=d4dc26e5-ea6a-421b-9699-9e9aba81b834" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Add the** *NotificationCenterPublish* **action**

A. In the VIVERSE extension, select the **TriggerAndAction** plugin for the **Select plugins** dropdown.

B. Add a **Trigger** and select **EntitySubscribeTriggerEnter**.

C. Add **local-player** to the **tags to filter** field.

D. Add an **Action** and select **NotificationCenterPublish.**

E. Create a unique name for the notification and add it to the **notification name to publish** field. In this example, the **ToggleEnabled** name is added.

<figure><img src="https://1140075852-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pMiThqqrBzfvP8uy5am%2Fuploads%2FkNBjYoUkyhQ1ZF9bbXBj%2Fimage.png?alt=media&#x26;token=af2833cc-a2e8-431f-b96c-61c3d0ec0a68" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Create a 3D object that will have it's enabled state toggled**

A. Add a 3D object to the scene.

B. Click the **Edit Viverse Extension** button.

<figure><img src="https://1140075852-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pMiThqqrBzfvP8uy5am%2Fuploads%2Fa9nCNayQBHJXLY0kBJZ1%2Fimage.png?alt=media&#x26;token=a1439af7-d631-4c74-bfa8-1af365154edc" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Add the** *NotificationCenterSubscribe* **trigger**

A. In the VIVERSE extension, select the **TriggerAndAction** plugin for the **Select plugins** dropdown.

B. Add a **Trigger** and select **NotificationCenterSubscribe**.

C. In the **notification name to subscribe** field, add the same name from the **notification name to publish** field.

D. Add an **Action** and select **EntityToggleEnabled**.

<figure><img src="https://1140075852-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pMiThqqrBzfvP8uy5am%2Fuploads%2F9B061m7TUtueJsuCCqKh%2Fimage.png?alt=media&#x26;token=66afc32e-c2aa-4b17-b46d-63090cd87e34" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}
