viverse logo

EntityEnableByTag

EntityEnableByTag - Create An Action That Enables Multiple Objects

This guide provides instructions for setting up the EntityEnableByTag action. In the sample app, once the avatar enters the trigger area, multiple balls are enabled.

1 2
When the avatar is outside the blue trigger area, the balls are disabled. When the avatar enters the blue trigger area, the balls are enabled.

1. In this example, a trigger is created and when triggered, an action enables multiple objects. Any object can be used 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 entity with a box shape is used instead of a 3D object. The entity does not have a RigidBody component. Right-click in the Hierarchy and select New Entity > Entity.

A. Add the tag local-player to the Tags field.

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 Half Extents field has been set to (2.5, .5, 2.5) for X, Y, Z.

D. The entity itself is currently set to Position (0, 0, 0) for X, Y, Z. In this example, the values for Position Offset are set to (0, -2, 0) for X, Y, Z to lower the collider to the ground.

E. Click the "EDIT VIVERSE EXTENSION" button to add the VIVERSE functionality.

3

2. To add the EntityEnableByTag 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 the tags to filter text field and add local-player tag.

F. Click "+" beside the selected module dropdown.

G. Click the type dropdown and select EntityEnableByTag action in the dropdown menu. For the EntityEnableByTag action to work, a Tag needs to be added. In this example, the Balls tag is created and added.

4

3. Multiple objects can be enabled by adding the Tag that was created in the previous step.

A. Click the Tags text field and add the Balls tag to multiple objects or parents of multiple objects.

5

 

 

Previous

EntityDisableById

Next

EntityDisableByTag