> For the complete documentation index, see [llms.txt](https://docs.viverse.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.viverse.com/playcanvas-toolkit/building-with-the-playcanvas-toolkit-legacy-v3/no-code-tools/trigger-and-action/entity-physics.md).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.viverse.com/playcanvas-toolkit/building-with-the-playcanvas-toolkit-legacy-v3/no-code-tools/trigger-and-action/entity-physics.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
