Entity Enabling & Disabling
This document provides several guides that can be used to show and hide objects in a VIVERSE project. These actions can be configured to execute when triggers are activated.
Last updated
Was this helpful?
This document provides several guides that can be used to show and hide objects in a VIVERSE project. These actions can be configured to execute when triggers are activated.
Last updated
Was this helpful?
Create An Action That Disables An Object
This guide provides instructions for setting up the EntityDisable action. In the sample app, once the avatar collides with the gold coin, the gold coin is disabled.
The avatar is not colliding with the gold coin.
Once the avatar collides with gold coin, the gold coin is disabled.
In this example, a trigger is created and when triggered, an action disables an object.
A. Add 3D object to the scene.
B. The Collision component is not required for EntityDisable action to work. The Collision component is required for the EntitySubscribeCollisionStart trigger that will be used in this example.
C. The Rigidbody component is not required for the EntityDisable action to work. The Rigidbody component is required for the EntitySubscribeCollisionStart trigger that will be used in this example.
D. Click the Edit Viverse Extension button.
Create An Action That Enables A Single Object
This guide provides instructions for setting up the EntityEnableById action. In the sample app, once the avatar enters the trigger area, the gold coin is enabled.
When the avatar is outside of the blue trigger area, the gold coin is disabled.
When the avatar enters the blue trigger area, the gold coin is enabled.
In this example, a trigger is created and when triggered, an action enables an object. Any object can be used as a trigger, as long as the object has a collision component. This example uses a 3D box as the trigger area.
A. Create a new 3D Box entity.
B. The Collision component is not required for EntityDisableById action to work. The Collision component is required for the EntitySubscribeTriggerEnter trigger that will be used in this example.
C. Adding a material is optional. A transparent material has been added so that the trigger area is visible in play mode.
D. Click the Edit Viverse Extension button.
A. In the VIVERSE extension, select the TriggerAndAction plugin for the Select plugins dropdown.
B. Add a Trigger and select EntitySubscribeTriggerEnter.
C. Add local-player to the tags to filter field.
D. Add an Action and select EntityEnableById.
E. Add an object that will be enabled when the avatar enters the trigger area. The golden_coin entity has been added to the pick up specify execution entity. The golden_coin entity has also been disabled by default.
Create An Action That Disables A Single Object
This guide provides instructions for setting up the EntityDisableById action. In the sample app, once the avatar leaves the trigger area, the gold coin is disabled.
When the avatar is inside the blue the trigger area, the gold coin is enabled.
When the avatar leaves the blue trigger area, the gold coin is disabled.
In this example, a trigger is created and when triggered, an action disables an object. Any object can be used as a trigger, as long as the object has a collision component. This example uses a 3D box as the trigger area.
A. Create a new 3D Box entity.
B. The Collision component is not required for EntityDisableById action to work. The Collision component is required for the EntitySubscribeTriggerLeave trigger that will be used in this example.
C. Adding a material is optional. A transparent material has been added so that the trigger area is visible in play mode.
Add the EntityDisableById action
A. In the VIVERSE extension, select the TriggerAndAction plugin for the Select plugins dropdown.
B. Add a Trigger and select EntitySubscribeTriggerLeave.
C. Add local-player to the tags to filter field.
D. Add an Action and select EntityDisableById.
E. Add an object that will be disabled when the avatar leaves the trigger area. The golden_coin entity has been added to the pick up specify execution entity. The golden_coin entity has also been disabled by default.
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.
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.
In this example, a trigger is created and when triggered, an action enables multiple objects. Any object can be used as a trigger, as long as the object has a collision component. This example uses a 3D box as the trigger area.
A. Create a new 3D Box entity.
B. The Collision component is not required for EntityEnableByTag action to work. The Collision component is required for the EntitySubscribeTriggerEnter trigger that will be used in this example.
C. Adding a material is optional. A transparent material has been added so that the trigger area is visible in play mode.
D. Click the Edit Viverse Extension button.
A. In the VIVERSE extension, select the TriggerAndAction plugin for the Select plugins dropdown.
B. Add a Trigger and select EntitySubscribeTriggerEnter.
C. Add local-player to the tags to filter field.
D. Add an Action and select EntityEnableByTag.
E. Create a unique Tag and add it to the enable entity with tag field. In this example, the Balls tag is added.
Create An Action That Disables Multiple Objects
This guide provides instructions for setting up the EntityDisableByTag action. In the sample app, once the avatar leaves the trigger area, multiple balls are disabled.
When the avatar enters the blue trigger area, the balls are enabled.
When the avatar leaves the blue trigger area, the balls are disabled.
In this example, a trigger is created and when triggered, an action disables multiple objects. Any object can be used as a trigger, as long as the object has a collision component. This example uses a 3D box as the trigger area.
A. Create a new 3D Box entity.
B. The Collision component is not required for EntityDisableByTag action to work. The Collision component is required for the EntitySubscribeTriggerLeave trigger that will be used in this example.
C. Adding a material is optional. A transparent material has been added so that the trigger area is visible in play mode.
Click the Edit Viverse Extension button.
A. In the VIVERSE extension, select the TriggerAndAction plugin for the Select plugins dropdown.
B. Add a Trigger and select EntitySubscribeTriggerLeave.
C. Add local-player to the tags to filter field.
D. Add an Action and select EntityDiableByTag.
E. Create a unique Tag and add it to the enable entity with tag field. In this example, the Balls tag is added.
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.
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. This example uses a 3D box as the trigger area.
A. Add a 3D object to the scene.
B. A Collision component is not required for the EntityFadeIn action to work. The Collision component is required for the EntitySubscribeCollisionStart trigger that will be used in this example.
C. A Rigidbody component is not required for the EntityFadeIn action to work. The Rigidbody component is required for the EntitySubscribeCollisionStart trigger that will be used in this example.
D. Click the Edit Viverse Extension button.
A. In the VIVERSE extension, select the TriggerAndAction plugin for the Select plugins dropdown.
B. Add a Trigger and select EntitySubscribeCollisionStart.
C. Add local-player to the tags to filter field.
D. Add an Action and select EntityFadeIn. To customize how long before the fade begins or duration of the fade, update delay in ms and duration in ms fields.
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.
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.
A. Add a 3D object to the scene.
B. A Collision component is not required for the EntityFadeOut action to work. The Collision component is required for the EntitySubscribeCollisionEnd trigger that will be used in this example.
C. A Rigidbody component is not required for the EntityFadeOut action to work. The Rigidbody component is required for the EntitySubscribeCollisionEnd trigger that will be used in this example.
D. Click the Edit Viverse Extension button.
A. In the VIVERSE extension, select the TriggerAndAction plugin for the Select plugins dropdown.
B. Add a Trigger and select EntitySubscribeCollisionEnd.
C. Add local-player to the tags to filter field.
D. Add an Action and select EntityFadeOut. To customize how long before the fade begins or duration of the fade, update delay in ms and duration in ms fields.
Create An Action That Toggles An Object's Enabled State
This guide provides instructions for setting up the EntityToggleEnabled action. In the sample app, every time the avatar enters the blue trigger area, a notification is sent to the purple box to toggle it’s enabled state.
The purple box is enabled/visible before the avatar enters the blue trigger area.
Once the avatar enters the blue trigger area, a notification is sent to the purple box to toggle it’s enabled stated. The purple box is disabled.
The avatar leaves the blue trigger area.
Once the avatar enters the blue trigger area again, a notification is sent to the purple box to toggle it’s enabled stated. The purple box is enabled again.
In this example, a trigger is created and when the avatar or other objects enter the trigger area, an action sends a notification to toggle another object's enabled state. Any object can be used as a trigger, as long as the object has a collision component.
A. Create a new 3D Box entity.
B. A Collision component is not required for the EntityToggleEnabled action to work. The Collision component is required for the EntitySubscribeTriggerEnter trigger that will be used in this example.
C. Adding a material is optional. A transparent material has been added so that the trigger area is visible in play mode.
D. Click the Edit Viverse Extension button.
A. In the VIVERSE extension, select the TriggerAndAction plugin for the Select plugins dropdown.
B. Add a Trigger and select EntitySubscribeTriggerEnter.
C. Add local-player to the tags to filter field.
D. Add an Action and select NotificationCenterPublish.
E. Create a unique name for the notification and add it to the notification name to publish field. In this example, the ToggleEnabled name is added.
A. In the VIVERSE extension, select the TriggerAndAction plugin for the Select plugins dropdown.
B. Add a Trigger and select NotificationCenterSubscribe.
C. In the notification name to subscribe field, add the same name from the notification name to publish field.
D. Add an Action and select EntityToggleEnabled.