EntityFadeOut - Create An Action That Fades Out An Object
This guide provides instructions for setting up the EntityFadeOut action. In the sample app, once the avatar stops colliding with the red platform, the red platform will fade out.
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 triggered, an action fades an object. Any object can be used as a trigger, as long as the object has a Collision component. Because this specific example uses a flattened 3D Cube that the avatar collides with, a RigidBody component needs to be added. 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 EntityFadeOut 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 EntitySubscribeCollisionEnd trigger is selected.
E. Click "+" beside the selected module dropdown.
F. Click the type dropdown and select EntityFadeOut action in the dropdown menu. In this example, a delay of 1000 milliseconds (1 second) has been added before the fade out begins and a duration of 3000 milliseconds (3 seconds) has been designated for how long the fade out should last.