# Entity Physics

***

## EntityRigidbodyAddForceInPhysics

**Create An Action That Adds Force To An Object**

This guide provides instructions for setting up the **EntityRigidbodyAddForceInPhysics** action. In the sample app, once the avatar enters the blue trigger area, a force is applied to the sphere.

| <img src="/files/WCLEXo2VwooELkvVfFrA" alt="" data-size="original"> | <img src="/files/TGqC6YORYct8cFxvR0Vy" alt="" data-size="original">                                                 |
| ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| The sphere is not moving before the avatar enters the trigger area. | Once the avatar enters the trigger area, a force is applied to the sphere in the direction based on the parameters. |

In this example, a trigger is created and when the avatar or other objects enters the trigger area, an action adds force to 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.

{% stepper %}
{% step %}

### Create a trigger area

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

B. This **Collision** component is not required for the **EntityRigidbodyAddForceInPhysics** 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/5zXBJmZVvXgwnDSC0z9Z" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Add the EntitySubscribeTriggerEnter trigger

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 **AddForce** name is added.

<figure><img src="/files/XAltr4Gyb4yzzCDVCgkk" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Create the 3D object that the physics force will be applied to

A. Create a new 3D object.

B. Add a **Collision** component.

C. Add a **Rigidbody** component.

D. Set the **Collision Type** to **Dynamic**.

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

<figure><img src="/files/JD9TAzAKUToBJKLfqrVQ" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Add the EntityRigidbodyAddForceInPhysics action

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

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

C. The same text that was added to the **notification name to publish** needs to be added to the **notification name to subscribe**.

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

E. In the **X Force**, **Y Force** and **Z Force** fields, add values for the amount of force to apply in each direction.

<figure><img src="/files/IRZkK6Ou5BLvA88aL7q0" 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-physics.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.
