# 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="/files/tq2IjsluQxaOyXxdSOO8" alt="" data-size="original"> | <img src="/files/fn6bS18j0bcXCM9J9lHI" 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="/files/YGnXcvLMgQzqM1i0pA4d" 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="/files/jJkTANLqBZQ8W0v7LBCD" 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="/files/o70rQ9RYxD4JxLn2SFOy" alt="" data-size="original">             | <img src="/files/UwPVbpFPZtvxAYWw7oUH" 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="/files/zaiIipm5heNRUta7W6J0" 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="/files/jFC3U0goQAL2UTCvoV9S" 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="/files/HUeKioKFNd4geHMfNzNS" alt="" data-size="original">            | <img src="/files/I3MRcnzgPfc3lIl80X8w" 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="/files/7rTcMhn8l1AQ1sJwshLz" 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="/files/e3Wtn6jCueWywuarMrIA" 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="/files/m5xh82h7rLBJau8uPF4E" alt="" data-size="original">       | <img src="/files/ROJJg6ZGQhmZuv7HP8D6" 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="/files/k8HWU8nzEr63HWWNiSxm" 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="/files/gqpZgvU6gK4gV0Phtb53" 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="/files/nLZhvm0Utt76XHIdTa8s" 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="/files/pWZnAZoZNYOYMgH52ibN" alt="" data-size="original">  | <img src="/files/nghbyxpLI85r8r6Ng28K" 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="/files/KEeasKJSA46kNQj1Ci1J" 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="/files/b6TbXfDHRulsadnPiNxJ" 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="/files/R6Oo47u6wwIzPTpUfyc9" 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="/files/VRGg7lrW5rwJSTMMY2uQ" alt="" data-size="original">                             | <img src="/files/lCvgEivuJE2WkrPyL83r" 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="/files/MpJ2qZy2jQCxQoc2mRph" 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="/files/stYqsvano601fh4m3mjA" 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="/files/gl6i3Gxs6O1sDgAXbFCK" alt="" data-size="original"> | <img src="/files/aIdCSvgWsePMOtivXqJm" 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="/files/NuhijiWL0fQD9vlRcXGJ" 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="/files/PS9TNORL2DrqArdPQBT0" 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="/files/C8fPiJ2GIw4MkRc7Johg" alt="" data-size="original"></td><td><img src="/files/uOUY92ixnD0dGtCUa1pl" 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="/files/j8VM6rbYxFRXJtXBWef2" alt="" data-size="original"></td><td><img src="/files/NzYK0Nm0U3eIB6WfFNdH" 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="/files/FOc3bI6sD7nc01WFv2tr" 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="/files/1zP4i6XA9xDzpfUpExIG" 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="/files/06ooBCx3r1ymDu4IoAl3" 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="/files/Km4iVxUYGMXBSO6FjaG1" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}


---

# 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://docs.viverse.com/playcanvas-toolkit/building-with-the-playcanvas-toolkit/no-code-tools/trigger-and-action/entity-enabling-and-disabling.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.
