Leaderboard assets

Use leaderboard configuration assets to manage leaderboard configurations in the Unity Editor. You can deploy these configurations to the Unity Cloud Dashboard using the Deployment package.

Prerequisites

To use leaderboard assets, you must install the Deployment package (com.unity.services.deployment).

Create leaderboard assets

To create a leaderboard asset:

  1. In the Unity Editor, right-click the Project window and select Create > Services > Leaderboard Configuration.
  2. Define the file format for your leaderboard configuration asset.

File format

Leaderboard configuration files must respect this JSON schema. The default leaderboard configuration file contains the $schema field to enable IntelliSense in IDEs.

Example

The following example contains these keys:

  • A string key Name
  • A string enum key SortOrder
  • A string enum key UpdateType
  • A JSON key ResetConfig
  • A JSON key TieringConfig
{
  "$schema": "https://ugs-config-schemas.unity3d.com/v1/leaderboards.schema.json",
  "Name": "leaderboard_config",
  "SortOrder": "asc",
  "UpdateType": "keepBest",
  "ResetConfig": {
    "Start": "2023-10-21T00:00:00-04:00",
    "Schedule": "0 12 1 * *"
  },
  "TieringConfig": {
    "Strategy": "score",
    "Tiers": [
      {
        "Id": "Gold",
        "Cutoff": 200.0
      },
      {
        "Id": "Silver",
        "Cutoff": 100.0
      },
      {
        "Id": "Bronze"
      }
    ]
  }
}

Deploy files

When you've created your leaderboard configuration files, you can deploy them to your chosen environment.

To deploy a file:

  1. In the Unity Editor, select Services > Deployment. For Unity Versions earlier than 2022, select Window > Deployment. The Deployment window displays your local leaderboard configuration files.
  2. Select your chosen leaderboard configuration files and select Deploy Selected.

You can now edit your leaderboard configuration in the Unity Cloud Dashboard.

For more information on working with the Deployment window, refer to Deployment package.