Lucky Raccoon Games
  • Start Here
  • Really Simple Steam Integration
    • Setup
    • Running Demo Scenes
    • Leaderboards
      • Setup
      • Initializing Leaderboards
      • Submitting Scores
      • Retrieving Leaderboard Data
    • Stats and Achievements
      • Setup
      • Unlocking Achievements Directly
      • Unlocking Achievements from Stats
    • Cloud Save
      • Setup
      • Saving and Loading Data
    • Friends List
      • Setup
      • Getting Friends Data
    • Drag & Drop UI Components
    • Troubleshooting
    • Useful Links
  • Really Simple Tutorials
    • Setup
    • Running Demo Scenes
    • Tutorial Screen
      • Categories
      • Items
      • Setting up the screen with your data
      • Tutorial Manager anatomy
    • Tutorial Popup
      • Showing and hiding Popups
      • Tutorial Popup anatomy
    • Integrations
      • New Input System
    • Troubleshooting
  • Support
Powered by GitBook
On this page
  1. Really Simple Steam Integration
  2. Leaderboards

Submitting Scores

To submit leaderboard scores you first need to initialize it (as explained on the previous page). Once the leaderboard is initialized, use the code below to submit a score:

[SerializeField]
SteamLeaderboards steamLeaderboards;

IEnumerator AsyncPostScoreToLeaderboard()
{
    steamLeaderboards.UpdateScoreToCurrentLeaderboard(1000);

    while (steamLeaderboards.IsPostingLeaderboardScore)
    {
        yield return null;
    }

    Debug.Log("Score submitted!");
    
    // Do what you want from here
}

The method AsyncPostScoreToLeaderboard() is a Coroutine because calls to the Leaderboard API are asynchronous

Unlike other assets, we will always check that the submitted score is the best before we send it to the leaderboard, which means you can call this method whenever you want in complete safety

PreviousInitializing LeaderboardsNextRetrieving Leaderboard Data

Last updated 2 years ago