EntitySubscribeCollisionEnd - Create A Trigger Based On When An Object Stops Colliding With Another Object
This guide provides instructions for setting up the EntitySubscribeCollisionEnd trigger. In the sample app, a flattened 3D cube is a trigger. Once the avatar stops colliding with the cube, an action occurs.
The avatar is colliding with the red platform. | Once the avatar stops colliding with the red platform, the red platform begins to fade out. |
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, a 3D cube is used. Right-click in the Hierarchy and select New Entity > 3D > Box.
A. In this example, the cube has been flattened by setting the values for Scale to (2, .1, 2) for X, Y, Z.
B. 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.
C. Resize the collider to the desired size. In this example, the Half Extents field has been set to (.5, .05, .5) for X, Y, Z.
D. Click the "EDIT VIVERSE EXTENSION" button to add the VIVERSE functionality.
2. To add the EntitySubscribeCollisionEnd 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 EntitySubscribeCollisionEnd 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 EntityFadeOut action is selected.