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.
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. |
1. 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.
2. To add the EntityCheckPoint 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 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.