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.
The avatar enters the green trigger area. | After entering the green trigger area, the avatar is teleported to another location. |
1. 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.
2. To add the TeleportAvatar action 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.