# Avatar Teleport & Checkpoint

***

## EntityCheckPoint

**Create An Action That Sets A New Spawn Point**

This guide provides instructions for setting up the **EntityCheckPoint** action. In the sample app, once the avatar enters one of the green trigger areas, the area becomes the new spawn location.

| <img src="https://1140075852-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pMiThqqrBzfvP8uy5am%2Fuploads%2FuL2mKNtgek9dWIvxIBHb%2Fimage.png?alt=media&#x26;token=d3a6bbd4-8bfe-4d3a-939b-3341bd7b7c71" alt="" data-size="original"> | <img src="https://1140075852-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pMiThqqrBzfvP8uy5am%2Fuploads%2FPxhStovtANrh7lCHAQs1%2Fimage.png?alt=media&#x26;token=177940e1-c805-4036-a688-0f4ebfcd6981" alt="" data-size="original"> | <img src="https://1140075852-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pMiThqqrBzfvP8uy5am%2Fuploads%2FxskPwC7cMX9WpZGokrFa%2Fimage.png?alt=media&#x26;token=5b230666-ef43-4b80-943b-702033e37178" alt="" data-size="original"> |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| The avatar enters the green trigger area and the trigger area becomes the new spawn location.                                                                                                                                                              | The avatar has fallen off the map and needs to be respawned.                                                                                                                                                                                               | When the avatar respawns, it is spawned at the new location.                                                                                                                                                                                               |

In this example, a trigger area is created and when triggered, an action sets a new spawn location. Any object can be used as a trigger, as long as the object has a collision component.&#x20;

{% stepper %}
{% step %}

### Create a trigger area

A. Create a new **Sphere** entity.

B. The **Collision** component is not required for **EntityCheckPoint** 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%2Fk1vyaXnjdQfwEdIC9luK%2Fimage.png?alt=media&#x26;token=f89c4963-9f76-4256-9015-fb138b662488" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Add the EntityCheckPoint 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 **EntityCheckPoint.**

E. Add an entity that has a position that will be used for the new spawn location. **SpawnLocation1** has been added to the **pick up an entity id**.

<figure><img src="https://1140075852-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pMiThqqrBzfvP8uy5am%2Fuploads%2F6SQDv4pEeSjaoXa2V7Vk%2Fimage.png?alt=media&#x26;token=d90a72be-2e7c-4575-80cc-ec7999a16643" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

## TeleportAvatar

**Create An Action That Teleports An Object To A Specific Location**

This guide provides instructions for setting up the **TeleportAvatar** action. In the sample app, once the avatar enters one of the green cylinder trigger areas, the avatar is teleported to another location.

| <img src="https://1140075852-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pMiThqqrBzfvP8uy5am%2Fuploads%2FS4oE9NYL1ZDIreyTtI2X%2Fimage.png?alt=media&#x26;token=f8f2139b-a7f5-4443-98bc-125a16e916a7" alt="" data-size="original"> | <img src="https://1140075852-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pMiThqqrBzfvP8uy5am%2Fuploads%2FHNte9lJ9H30wc0umUZ7x%2Fimage.png?alt=media&#x26;token=26ff9420-e336-4dd2-b1c0-75ac131e9337" alt="" data-size="original"> |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| The avatar enters the green trigger area.                                                                                                                                                                                                                  | After entering the green trigger area, the avatar is teleported to another location.                                                                                                                                                                       |

In this example, a trigger is created and when the avatar or other objects enter the trigger area, an action teleports the avatar to a specific location. Any object can be used as a trigger, as long as the object has a collision component.&#x20;

{% stepper %}
{% step %}

### Create a trigger area

A. Create a new **Sphere** entity.

B. The **Collision** component is not required for **TeleportAvatar** 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%2FYLQ5KVsEyY2gWkFoneaq%2Fimage.png?alt=media&#x26;token=4a65c8ef-af4a-49b5-b2f4-ac24b812cc1e" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Add the TeleportAvatar 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 **EntityTeleportAvatar.**

E. Add an entity that has a position that will be used for the teleport location. **TeleportLocation2** has been added to the **Specify the Entity whose location you want to teleport to**.

<figure><img src="https://1140075852-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4pMiThqqrBzfvP8uy5am%2Fuploads%2FMXo75kMUcPK8wcUdkpXt%2Fimage.png?alt=media&#x26;token=91c8fa36-ee58-49c7-804c-e2970de04c10" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}
