viverse logo

EntitySubscribeCollisionStart

EntitySubscribeCollisionStart - Create A Trigger Based On When An Object Collides With Another Object

This guide provides instructions for setting up the EntitySubscribeCollisionStart trigger. In the sample app, the golden_coin is a trigger. Once the avatar collides with the golden_coin, an action occurs.

1 2
The avatar approaches the gold coin. Once the avatar collides with the gold coin, the gold coin is removed.

1. In this example, a trigger is created and when the avatar or other objects collide with the trigger, an action is initiated. Any object can be used as a trigger, as long as the object has a Collision component. Because this specific example uses a 3D object that the avatar and other objects can collide with, a RigidBody component needs to be added. In this example, the object golden_coin is used, but a simple cube will suffice.

A. Click the "Add Component" button. Select Physics > Collision to add a Collision component. Click the "Add Component" button again and select Physics > Rigid Body to add the RigidBody component.

B. In this example, the golden_coin has a Mesh collider that encompasses the entire object by default. Resize the collider here if the collider's size needs to be changed.

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

3

2. To add the EntitySubscribeCollisionStart trigger 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 the EntitySubscribeCollisionStart option in the dropdown menu.

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

F. Click the type dropdown and select a desired action. In this example, the EntityDisable action is selected.4

Previous

EntitySubscribeTriggerLeave

Next

EntitySubscribeCollisionEnd