Avatar Teleport & Checkpoint
This document provides guides that can be used to change the spawn location of an avatar and transfer an avatar to a different location. These actions can be configured to execute with triggers.
Last updated
This document provides guides that can be used to change the spawn location of an avatar and transfer an avatar to a different location. These actions can be configured to execute with triggers.
Last updated
© 2024 HTC CORPORATION
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.
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. Because this specific example creates an empty area that the avatar and other objects can pass through, a simple cylinder is used. The cylinder does not have a RigidBody component. Right-click in the Hierarchy and select New Entity > 3D > Cylinder.
A. In this example, the cylinder has been stretched by setting the values for Scale to (1, 2, 1) for X, Y, Z.
B. Click the "Add Component" button. Select Physics > Collision to add a Collision component.
C. Resize the collider to the desired size. In this example, the Height field has been set to 2.
D. Click the "EDIT VIVERSE EXTENSION" button to add the VIVERSE functionality.
A. Click the Select plugins text field and select TriggerAndAction in the dropdown menu.
B. Click "+" beside the Select a module and add dropdown.
C. Click "+" beside the selected module dropdown.
D. Click the type dropdown and select a desired trigger. In this example, the EntitySubscribeTriggerEnter trigger is selected.
E. Click "+" beside the selected module dropdown.
F. Click the type dropdown and select EntityCheckPoint action in the dropdown menu. For the EntityCheckPoint action to work, an entity needs to be added to the pick up an entity id field. This location will be the new spawn location.
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.
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. Because this specific example creates an empty area that the avatar and other objects can pass through, a simple 3D cylinder is used. The entity does not have a RigidBody component added. Right-click in the Hierarchy and select New Entity > 3D > Cylinder.
A. In this example, the cylinder has been enlarged by setting the values for Scale to (1, 2, 1) for X, Y, Z.
B. Click the "Add Component" button. Select Physics > Collision to add a Collision component.
C. Resize the collider to the desired size. In this example, the Height field has been set to 2.
D. Click the "EDIT VIVERSE EXTENSION" button to add the VIVERSE functionality.
A. Click the Select plugins text field and select TriggerAndAction in the dropdown menu.
B. Click "+" beside the Select a module and add dropdown.
C. Click "+" beside the selected module dropdown.
D. Click the type dropdown and select a desired trigger. In this example, the EntitySubscribeTriggerEnter trigger is selected.
E. Click "+" beside the selected module dropdown.
F. Click the type dropdown and select TeleportAvatar action in the dropdown menu. For the TeleportAvatar action to work, an entity needs to be added to the Specify the Entity whose location you want to teleport to. The avatar will be teleported to the entity's location.