LogoLogo
VIVERSESupportBlogDiscord
  • Creator Tools
  • Polygon Streaming
  • Introduction to Creator Tools
  • Publishing with Your VIVERSE Account
  • Optimization
  • World Decoration
    • Edit Mode
    • Supported Media & Settings
    • Creating From Templates
      • Pet Rescue Template Project
  • PlayCanvas SDK
    • PlayCanvas Extension Setup
    • Publishing to VIVERSE
    • Scene Settings
    • No Code Tools
      • Sample Project
      • Quests
      • Trigger & Action
        • Event Listeners
        • Entity Enabling & Disabling
        • Entity Collision Enabling & Disabling
        • Entity Physics
        • Avatar Teleport & Checkpoint
        • Animation & Sound
        • Asset Management
      • Media
        • Polygon Streaming
        • Images
        • Video
        • Audio
      • Pick and Throw
      • Networked
      • Seat
      • GPU Mesh Instancing
    • Custom Code
      • Connecting No-Code Events to Custom Scripts
      • Introduction to MJS
      • Camera Management: Settings and Switching
    • Examples
      • Create Your First PlayCanvas Project
      • SHADEART | Custom Shader
      • WITHIN | A Generative Audiovisual Maze
      • First Person Shooter with Destruction
  • Unity SDK
    • Porting from Unity to PlayCanvas
Powered by GitBook
LogoLogo

Important Links

  • COOKIE POLICY
  • TERMS OF SERVICE
  • PRIVACY POLICY
  • VIVERSE PARTNERS

Socials

  • X / Twitter
  • LinkedIn
  • Instagram

© 2025 HTC CORPORATION

On this page
  • EntitySubscribeTriggerEnter
  • EntitySubscribeTriggerLeave
  • EntitySubscribeCollisionStart
  • EntitySubscribeCollisionEnd
  • NotificationCenterSubscribeEntityPicking
  • NotificationCenterPublish & NotificationCenterSubscribe

Was this helpful?

Edit on GitHub
Export as PDF
  1. PlayCanvas SDK
  2. No Code Tools
  3. Trigger & Action

Event Listeners

This document provides several guides that can be used to setup event listeners in a VIVERSE project. The event listeners use triggers. Triggers can be configured to perform actions once activated.

PreviousTrigger & ActionNextEntity Enabling & Disabling

Last updated 3 months ago

Was this helpful?


EntitySubscribeTriggerEnter

Create A Trigger Based On When An Object Enters An Area

This guide provides instructions for setting up the EntitySubscribeTriggerEnter trigger. In the sample app, the trigger areas are outlined in blue. Once the avatar enters into the blue area, an action occurs.

The avatar is outside the blue trigger area and the gold coin is not visible.

The avatar has entered the blue trigger area and the gold coin is visible.

In this example, a trigger area is created and when the avatar enters the trigger area, an action is initiated. 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.

1

Create a trigger area

A. Create a new 3D Box entity.

B. Add a Collision component.

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.

2

Add the EntitySubscribeTriggerEnter trigger

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.

EntitySubscribeTriggerLeave

Create A Trigger Based On When An Object Leaves An Area

This guide provides instructions for setting up the EntitySubscribeTriggerLeave trigger. In the sample app, the trigger areas are outlined in blue. Once the avatar leaves the blue area, an action occurs.

The avatar is inside the the blue trigger area and the gold coin is visible.

The avatar leaves the blue trigger area and the gold coin is no longer visible.

In this example, a trigger area is created and when the avatar leaves the trigger area, an action is initiated. 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.

1

Create a trigger area

A. Create a new 3D Box entity.

B. Add a Collision component.

C. Adding a material is optional. A transparent material has been added so that the trigger area is visible in play mode.

D. Adding a material is optional. A transparent material has been added so that the trigger area is visible in play mode.

2

Add the EntitySubscribeTriggerLeave trigger

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.

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.

The avatar approaches the gold coin.

Once the avatar collides with the gold coin, the gold coin is removed.

In this example, a trigger is created and when the avatar collides 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 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.

1

Create the 3D object that the avatar will collide with

A. Add 3D object to the scene.

B. Add a Collision component.

C. Add a Rigidbody component.

D. Click the Edit Viverse Extension button.

2

Add the EntitySubscribeCollisionStart trigger

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 EntityDisable.

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.

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 can collide with, a RigidBody component needs to be added.

1

Create the 3D object that the avatar will collide with

A. Add 3D object to the scene.

B. Add a Collision component.

C. Add a Rigidbody component.

D. Click the Edit Viverse Extension button.

2

Add the EntitySubscribeCollisionEnd trigger

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.

NotificationCenterSubscribeEntityPicking

Create A Trigger Based On When A User Clicks An Object

This guide provides instructions for setting up the NotificationCenterSubscribeEntityPicking trigger. In the sample app, the user clicks on the buttons to show and hide the whale.

The whale is visible.

When the user clicks on the whale, the whale is disabled.

In this example, a trigger area is created on a button. When the user clicks on the trigger area, an action causes the 3D model to be disabled. Any object can be used as a trigger, as long as the object has a collision component.

1

Create the 3D object that the user will click on

A. Add a 3D object to the scene. In this example, a button is used, but any 3D object will work.

B. Add a Collision component.

C. Click the Edit Viverse Extension button.

2

Add the NotificationCenterSubscribeEntityPicking trigger

A. In the VIVERSE extension, select the TriggerAndAction plugin for the Select plugins dropdown.

B. Add a Trigger and select NotificationCenterSubscribeEntityPicking.

C. Add an Action and select EntityDisable. Add an object that will be disabled.

NotificationCenterPublish & NotificationCenterSubscribe

An Action And Trigger Combination That Allows An Object To Send A Notification And Another Object Receives The Notification

This guide provides instructions for setting up the NotificationCenterPublish action and the NotificationCenterSubscribe trigger. In the sample app, every time the avatar enters the green trigger area, a notification is sent to the wall and the collider on the wall is toggled on/off. The wall is green when the avatar can pass through and red when the avatar can not pass through.

Before the avatar enters the green trigger area, the wall is red and the avatar can not pass through the wall.

Once the avatar enters the green trigger area, the green trigger sends a notification to the wall and the collider on the wall is disabled.

In this example, a trigger is created and when the avatar enters the trigger area, an action sends a notification to another object. The other object receives the notification via trigger, then initiates an action.

1

Create the 3D object that will send the notification

A. Add a 3D object to the scene.

B. The Collision component is not required for NotificationCenterPublish action or NotificationCenterSubscribe trigger to work. The Collision component is required for the EntitySubscribeTriggerEnter trigger that will be used in this example.

C. Click the Edit Viverse Extension button.

2

Add the NotificationCenterPublish action

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 notification name and add it to the notification name to publish field. In this example, the notification is called ToggleWall.

3

Create the 3D object that will receive the notification

A. Add a 3D object to the scene.

B. The Collision component is not required for NotificationCenterPublish action or NotificationCenterSubscribe trigger to work. The Collision component is required for the EntityToggleCollision action that will be used in this example.

C. The Rigidbody component is not required for the NotificationCenterPublish action or NotificationCenterSubscribe trigger to work. The Rigidbody component is required for the EntityToggleCollision action that will be used in this example.

D. Click the Edit Viverse Extension button.

4

Add the NotificationCenterSubscribe action

A. In the VIVERSE extension, select the TriggerAndAction plugin for the Select plugins dropdown.

B. Add a Trigger and select NotificationCenterSubscribe.

C. The same text that was added to the notification name to publish needs to be added to the notification name to subscribe.

D. Add an Action and select EntityToggleCollision.