viverse logo

Trigger & Action

The Trigger and Action feature allows various objects or Avatars to generate different response outcomes based on different trigger conditions.

 

Adding Trigger

  • Create or select a entity in your scene
1
  • Select Trigger and press “+“ to add a new trigger

 

Type

Choose the type of trigger condition

  • PCAppEventSubscribe - Triggered by Playcanvas supported plugin event
  • NotificationCenterSubscribe - Triggered by receiving NotificationCenterPublish in Action

  • NotificationCenterSubscribeEntityPicking - Triggered by Mouse clicking

  • EntitySubscribeAnimationStart - Triggered by the start of the animation

  • EntitySubscribeAnimationEnd - Triggered by the end of the animation

  • EntitySubscribeCollisionStart - Physical object just starting to touch Collider

  • EntitySubscribeCollisionEnd - Physical object leaving the Collider

  • EntitySubscribeTriggerEnter - Enter Trigger Area

  • EntitySubscribeTriggerLeave - Leave Trigger Area

Sync the trigger

Synchronize triggered events so that other users can also see the event being triggered

on / off

Throttle in ms

Set the delay in milliseconds before execution

milliseconds

Notification name to subscribe

When using Notification-related functions, specify the source of the Action

 

add Action

Specify the actions to be performed after the trigger

 

There are two types of Triggers:

Triggers

Triggers have a single trigger condition

Flows

Flows allow trigger conditions to be either "and" or "or"

 

Adding Action

step1 After you create a trigger, Select a module of Action. There will be an additional panel to show all the settings.

2
 

Type

Choose the type of Action condition

  • NotificationCenterPublish - As the source of the Notification functionality Trigger.
  • EntityToggleEnabled - Set Entity to an open/closed state

  • EntityEnable - Enable Entity, make it appear.

  • EntitiyDisable - Disable the Entity, make it disappear.

  • EntityFadeIn - Entity gradually appears

  • EntityFadeOut - Entity gradually disappears

  • EntityPlaySound - Play music / sound

  • EntityEnableCollision - Activate the Collision state of the Entity.

  • EntityDisableCollision - Deactivate the Collision state of the Entity.

  • EntityToggleCollision - Set Entity’s Collision to an open/closed state

Delay in ms

Set the delay in milliseconds before execution

 

 

Previous

Playcanvas Extensions Functions

Next

Sample Project