EntityFadeIn - Create An Action That Fades In An Object
This guide provides instructions for setting up the EntityFadeIn action. In the sample app, once the avatar starts colliding with the red platform, the red platform will fade in.
The red platform has been faded out and is invisible, but the avatar can still collide with it. | Once the avatar begins colliding with the invisible red platform, the red platform fades in and is now visible. |
1. In this example, a trigger is created and when triggered, an action fades in the object it has been added to. 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 EntityFadeIn 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 EntitySubscribeCollisionStart trigger is selected.
E. Click "+" beside the selected module dropdown.
F. Click the type dropdown and select EntityFadeIn action in the dropdown menu. In this example, a delay of 1000 milliseconds (1 second) has been added before the fade in begins and a duration of 3000 millisecond (3 seconds) has been designated for how long the fade in should last.