For the complete documentation index, see llms.txt. This page is also available as Markdown.

Actions

Learn how use Actions in your VIVERSE Worlds, and how to link them to Triggers and / or Custom Scripts


About

Actions is another fundamental part of VIVERSE Framework, allowing creators to devise a wide range of possible "verbs" that their experience can do, without writing a single line of code. The typical examples are:

  • Enable / Disable / Toggle Entity or a group of Entities

  • Teleport Player to a new location

  • Fade In or Fade Out some Entity

  • Play Animation / Particle Effect or Sound

  • Initialize Quest or advance particular Quest Task

  • And so on, and so forth

Usage

Actions are typically paired with Triggers, where one Trigger can execute multiple Actions in parallel, or one Action can be executed by any Trigger matching its name. It's also possible to execute Actions from your Custom Scripts, opens up even more possibilities for interactivity!

Here is a simple example of an Action being executed by a Trigger:

1

Setup Trigger

  • Create a new empty Entity in your Scene

  • Add 3D > Render Component of type Box. Your Entity should be visible in your Scene now

  • Add Physics > Collision Component of type Box as well. Adjust its params if necessary

  • Click Add Viverse Component button and select Rule > Trigger. The viverseTrigger script will be added to your Entity

  • In Trigger Component, add a new entry to the Trigger List, by entering 1

  • Leave Trigger type at OnSelect (default), and give it a unique Name, for example box.clicked

2

Setup Action

  • With your Entity selected, click Add Viverse Component button once again, and select Rule > Action. The viverseAction script will be added to your Entity

  • In Action Component, add a new entry to the Action List, by entering 1

  • Populate Trigger / Condition field with your Trigger Name, which is box.clicked in our case

  • Leave all other params at their defaults - ToggleEntities, Toggle, Self

3

Test and verify

  • Now we can test our Trigger / Action pair!

  • Launch your Scene in a new tab, walk towards white box Entity and click it

  • If you set up everything correctly — the Entity should disappear on your click

It's not really necessary to have both Trigger and Action Components on the same Entity! For the purpose of your experience you can have as many Entities as you like, each with its own Trigger or Action, or a combination of those.

The only important rule is that Trigger's Name param should match an Action's Trigger / Condition one if you want them to be linked together

Reference


Toggle Entities

Enables or disables a given Entity according to desired State parameter. Supported states:

  • Enable / Disable / Toggle

What Entity is enabled or disabled can be controlled by Entity Filter selector:

  • Self - current Entity (default)

  • Tag - all Entities with specific Tag

  • TargetEntity - particular Entity in the Scene


Toggle Component

Enables or disables particular Component on a given Entity according to desired State parameter. Supported states:

  • Enable / Disable / Toggle

Supported Components to destroy:

  • Collision / Rigidbody

As with ToggleEntities type, Entity Filter selector controls what Entity is affected by this Action


Destroy Entities

Destroys a given Entity based on Entity Filter selector. See ToggleEntities above for available filter options


Fade Transition

Fades In or Out a given Entity over Duration period. Supported Fade Types:

  • FadeIn / FadeOut

The Entity should have Mesh or Render Component attached, with transparent Materials.

As with ToggleEntities type, Entity Filter selector controls what Entity is affected by this Action


Push Notification

Fires a Notification Event with a given Event Name. This event can be picked up by another Trigger Entity of type OnNotificationEvent. You can use it to send / receive custom Notification Events between different Entities in your Scene


Teleport Player

Teleports the Player to a given 3D point in your Scene


Push Entity

Applies a 3D impulse to a given Entity, provided this Entity has Rigidbody Component attached. As with ToggleEntities type, Entity Filter selector controls what Entity is affected by this Action


Sound Control

Plays or stops a Sound on a given Entity, provided this Entity has Sound Component attached. Audio Name refers to a Sound Slot name. Supported actions:

  • Play / Stop

As with ToggleEntities type, Entity Filter selector controls what Entity is affected by this Action


Animation Control

Plays an Animation on a given Entity with Duration blend time, provided this Entity has Animation Component attached. Animation Name refers to an Animation Clip. As with ToggleEntities type, Entity Filter selector controls what Entity is affected by this Action


Particle System Control

Plays a Particle Effect on a given Entity, provided this Entity has Particle System Component attached. As with ToggleEntities type, Entity Filter selector controls what Entity is affected by this Action


Quest

Updates state of Quest with a given Quest Name, based on Command provided. Supported commands:

  • Start Quest / Reset Quest

  • AddTaskProgress / CompleteTask


Set Spawn Point

Sets the next Spawn Point for the Player to a 3D point from provided list. If the list contains multiple options - the point will be selected randomly out of them


Seat

Executes Player sitting mechanic for a given Seat Entity, according to provided Command. The Entity should have Seat Component attached. Supported commands:

  • Sit / Leave


Open Link

Opens URL with a given Link


Last updated

Was this helpful?