Documentation

Support

Unity Dashboard

Preview, create, and delete triggers using the graphical interface of the Unity Dashboard.
Read time 5 minutesLast updated 18 hours ago

The Unity Dashboard is a simple way to get started as it allows you to take full control of your triggers through a graphical interface. This section covers how you can preview, create and delete your triggers.

Preview triggers

You can access a list of all triggers for an environment from the Unity Dashboard:
  1. In the Unity Dashboard, select Cloud Code.
  2. Select Triggers.
  3. Select an environment from the list of environments.
A list of all triggers in the selected environment for the project appears. The table contains the name, trigger, type, and last updated timestamp.

Trigger details

You can navigate to the trigger details page by selecting a trigger from the list of triggers. The trigger details page shows you the following information:

Data

Description

NameThe name of the trigger.
TypeThe type of trigger: Event or Schedule.
TriggerThe event that triggers the script. For example,
key_saved
by
Cloud Save
.
Event TypeThe full event type, for example,
com.unity.services.cloud-save.key-saved.v1
. For more information on event types, refer to Event structure.
Last updatedThe RFC3339 timestamp of the last time the trigger configuration was updated.
The trigger definition card shows a breakdown of the trigger configuration:
  • when this happens (event type)
  • where (filters)
  • do this (action, Cloud Code script or module)
The filters are displayed in a chips, showing the attribute, operator, and value of the filter. If the dashboard can't display the filter in the chip format, the dashboard displays the filter in its original CEL format.

Navigate to logs

To navigate to the logs page for trigger and view the logs for the trigger execution, select the View Trigger Logs button. Learn more about logs in the Logs section.

Navigate to action

If the trigger is associated with an existing script or module, the trigger definition card provides a link to the script or module. To navigate to the script or module details page, select the link.

Create a trigger

You can create an event-based trigger in the Unity Dashboard.
  1. In the Unity Dashboard, select Products > Cloud Code.
  2. Select Triggers.
  3. Select New trigger.
  4. Fill in the following information:
    • Name: A name for your trigger, used to identify the configuration. Trigger names must be unique across the project and environment and not exceed 255 characters.
    • Type: The type of the trigger. Event-based triggers refer to triggers triggered by UGS-emitted events.
  5. Select Next.
  6. In the next step, select the following information:
    • In the When this happens section:
      1. Select the Add Trigger Event button.
      2. Select the event you want to trigger the script.
      3. Select Add Filter to add a filter to the event.
    • In the Do this section:
      1. Select the Add Action dropdown.
      2. Select the action you want to perform when the trigger is activated. This action can be a script or a module.
  7. Select Confirm.
Trigger creation redirects you to the trigger list page. To inspect the trigger configuration, select the trigger name in the table.

Filters in the Unity Dashboard

You can add filters to the trigger configuration to specify the conditions under which the trigger activates. The Unity Dashboard supports a limited set of filters that you can use to filter the event payload. Familiarize yourself with how filters work in the Filters section. Refer to Supported UGS events to inspect event payloads for each UGS event.

Supported operators

The Unity Dashboard displays different operators depending on the attribute type:

Operator

Supported by

equals toAll attribute types
not equals toAll attribute types
greater thanint, double and JSON types
greater than or equals toint, double and JSON types
less thanint, double and JSON types
less than or equals toint, double and JSON types
matchesstring and JSON types
not matchesstring and JSON types
containsstring and JSON types
starts withstring and JSON types
ends withstring and JSON types

Join filters

You can define up to 10 filters for a trigger. You can join filters by the logical operators
AND
and
OR
. You can use these operators to combine multiple filters to create complex conditions.

Define filters with the Cloud Save key-saved event

You can define your trigger to only activate when a specific key is saved in Cloud Save. For example, you can define a filter to only activate the trigger when the key
playerData
is saved.
In the Unity Dashboard, you can add this filter to the trigger configuration:
  1. In the When this happens section, select the Add Event button.
  2. Select the event dropdown and choose the Cloud Save key-saved event.
  3. Select the Add Filter button.
  4. In the new Filter card:
    1. In the first dropdown, select the
      key
      attribute.
    2. In the second dropdown, select the
      equals to
      operator.
    3. In the third dropdown, enter the value
      playerData
      .
If you define this filter, you ensure that the trigger only activates when the key
playerData
is saved in Cloud Save.

Define filters with the Leaderboards score-submitted event

You can define your trigger to only activate when a specific score is submitted to a leaderboard. For example, you can define filters to only activate the trigger for a score in a specific range. In the Unity Dashboard, you can add this filter to the trigger configuration:
  1. In the When this happens section, select the Add Event button.
  2. Select the event dropdown and choose the Leaderboards score-submitted event.
  3. Select the Add Filter button.
  4. In the new Filter card:
    1. In the first dropdown, select the
      score
      attribute.
    2. In the second dropdown, select the
      greater than
      operator.
    3. In the third dropdown, enter the value
      0
      .
  5. Select the Add Filter button.
  6. In the new Filter card:
    1. In the first dropdown, select the
      score
      attribute.
    2. In the second dropdown, select the
      less than
      operator.
    3. In the third dropdown, enter the value
      100
      .
If you define this filter, you ensure that the trigger only activates when a score between 0 and 100 is submitted to a leaderboard.

Delete a trigger

To delete triggers from the Unity Dashboard:
  1. Navigate to the Triggers list page.
  2. Select the bin icon. A dialog appears to warn you that trigger deletion can't be undone.
  3. Select Delete to confirm the deletion.
Alternatively, you can navigate to the trigger details page and select the Delete button to delete the trigger.