Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We’re making changes to the Unity Runtime Fee pricing policy that we announced on September 12th. Access our latest thread for more information!
    Dismiss Notice
  3. Dismiss Notice

Question Leaderboard reset event (cloud code)

Discussion in 'Leaderboards' started by Brogan89, Apr 28, 2023.

  1. Brogan89


    Jul 10, 2014
    My end goal is to have a weekly leaderboard.

    I'm wanting to be able to set up some cloud code which can listen for the leaderboard reset event get the results and distribute rewards to the player's cloud save data.

    I guess an alternative would be to have the client check their result upon returning to the app and updating the rewards client side... but I feel like doing this on the cloud is a better solution. That way I don't need to archive leaderboards.
  2. IainUnity3D


    Unity Technologies

    Oct 5, 2022
    Hi there!

    So this is a great use case folks have been asking us about. We don't currently have a way to trigger something when a leaderboard resets but we hope will be able to provide a way to solve for this later in the year.

    One approach you can do right now, is to not use automatic resets on a leaderboard and instead use a Cloud Code function invoke a Leaderboard Reset and to check who should get a reward and update data stored in Cloud Save for those players.

    You could also use Leaderboard Archives and have game clients call a Cloud Code function to check if a player is ranked highly on the previous leaderboard and if they got their reward already (using Cloud Save both to store the reward and to record that they were given a reward).

    There isn't currently a fully server authoritative way to do something like this, but that something we actually hope to have a solution for that in Cloud Save very soon!
    Last edited: May 2, 2023
    Brogan89 likes this.
  3. o-m-g


    Oct 27, 2022
    Hi There, is this functionality available yet?