Beamable Documentation

Welcome! Here is everything you need to get setup and become a Beamable expert.

Begin with the Getting Started section, learn more about Beamable features in the Manual, and check out the Script Reference APIs for advanced workflows.

Choose from the following...













.








.

Leaderboard Flow

Allow player to manage leaderboard

Overview

This page includes everything needed to use this feature in the "Beamable SDK for Unity". Or watch this video.

The purpose of this feature is to allow the player to see the LeaderboardLeaderboard - A list of high scores by all players of a game.

The User Interface

When setup properly, the player's user interface in the game project will be as follows.

The Beamable "Leaderboard Flow" UI in the Unity Game Window

Steps

Follow these steps to get started.

Step

Detail

  1. Open the "Toolbox" Window

• Unity → Window → Beamable → Open Beamable Toolbox

  1. Add the "Leaderboard Flow" Prefab

• Drag this Prefab from the Beamable Toolbox Window to the Unity Hierarchy Window

Here is the "Beamable" menu as seen in Unity.

The “Beamable” Menu

Here is the feature Prefab as seen in the Beamable Toolbox.

The Beamable "Leaderboard Flow" in the Beamable Toolbox Window

Advanced

Here are a few advanced configuration options and workflows.

Creating Leaderboard Content

LeaderboardLeaderboard - A list of high scores by all players of a game content is required to properly populate the Leaderboard UI.

Step

Detail

  1. Open the Content Manager Window

• Unity → Window → Beamable → Open Content Manager

  1. Create the "Leaderboard " content
• Select the content type in the list • Press the "Create" button • Populate the content name
  1. Open the Unity Project Window

• Unity → Window → General→ Project

  1. Select the leaderboard asset

• Search by the name given in step #3
• View the asset in the Unity Inspector Window

  1. (Optional) Configure data fields

Note: The Write_self variable allows for control of Leaderboard permissions. See the Beamable Security & Permissions callout for more info.

  1. Save the Unity Project

• Unity → File → Save Project

Best Practice: If you are working on a team, commit to version control in this step.

  1. Publish the content

• Press the "Publish" button in the Content Manager Window

❗️

Beamable Security & Permissions

Each Leaderboard content object asset includes a write_self field.

True: Allows for client-authoritative score updates. Benefits include ease-of-use for game makers and is ideal for a game which can tolerate the occasional cheater. It is hackable.
False: Allows for server-authoritative score updates and requires additional setup via Microservices. Benefits include higher system security and is ideal for a game which requires that. It is less hackable.

Rewarding Leaderboard-Related Score

To appear on the Leaderboard, a player must have a competitive score.

During Development

The Portal allows the game maker to view and edit a player's score. This is a helpful, temporary workflow during the design and development of a new game feature.

During Production

To properly reward the players with score in production code, use custom C#. See the following example for inspiration.

Code

📘

Beamable SDK Examples

This and all examples are available for download at GitHub.com/Beamable_SDK_Examples

using Beamable.Common.Leaderboards;
using UnityEngine;

namespace Beamable.Examples.Services.LeaderboardService
{
    /// <summary>
    /// Demonstrates <see cref="LeaderboardService"/>.
    /// </summary>
    public class LeaderboardServiceExample : MonoBehaviour
    {
        //  Fields  ---------------------------------------
        [SerializeField] private LeaderboardRef _leaderboardRef = null;
        [SerializeField] private double _score = 100;

        //  Unity Methods  --------------------------------
        protected void Start()
        {
            Debug.Log($"Start()");
            
            LeaderboardServiceSetScore(_leaderboardRef.Id, _score);
        }

        //  Methods  --------------------------------------
        private async void LeaderboardServiceSetScore(string id, double score)
        {
            var beamableAPI = await Beamable.API.Instance;
            
            Debug.Log($"beamableAPI.User.id = {beamableAPI.User.id}");
            
            await beamableAPI.LeaderboardService.SetScore(id, score);
                
            Debug.Log($"LeaderboardService.SetScore({id},{score})");
        }
    }
}

Managing Leaderboard Via Portal

The Portal allows the game maker to manage LeaderboardLeaderboard - A list of high scores by all players of a games.

Step

Detail

  1. Open the Portal Window

• See Portal for more info

  1. Click a Realm
  1. Click a Leaderboard
  1. Administer the Leaderboard

Available Operations
• Delete a single score
• Delete the Leaderboard
• Clear the Leaderboard

Note: Some of these operations cannot be undone.

📘

FAQ

Here are highlights from the Beamable FAQ. See FAQ for more info.

Leaderboard Flow

Updated 25 days ago


Leaderboard Flow


Allow player to manage leaderboard

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.