Sharp Edges GAME DEVELOPMENT NOTES

How to Keep Fake Scores Off Your Unity Leaderboard


Say your daily challenge tops out at 4,000 points and someone shows you a leaderboard entry for 99,999. First check whether a player account can write directly to the leaderboard. If only your backend can write, check what it verifies before it posts a score. A Cloud Code function that saves the number it receives still lets the game client decide the result.

The settings below are for Unity Gaming Services (UGS) Leaderboards. The scoring examples are for a game where most of the run happens on the player's device.

Where to Start When a Unity Leaderboard Score Looks Wrong

Before you remove a live entry, record the player ID, leaderboard, score, and any matching server-side run record. Start with the row that matches what you found.

What you see What to check first What to do
A player account can still write to the board directly Check the Access Control policy deployed for that board and environment. Deny player writes. Test that players can still read the board and that the backend can post valid scores.
A score exceeds the maximum for its challenge Find the rules that applied to that run. Check whether the server applied the right cap before writing it. Enforce the cap for that challenge and rules version. If the run was valid under older rules, decide whether those scores belong on the same board.
The score is possible, but you can't tell how it was earned Look for a matching run and see which parts the backend can verify independently. Treat the score as unverified. If the board awards prizes, keep it out of the eligible rankings until you can verify it.
A player's total jumps after their connection drops Look for multiple finish requests for the same run. Check the board's update strategy and whether the earlier write succeeded. Test what happens when the score is saved but the response is lost. Check whether the points already counted before adding them again.

Unity's Delete Player Score operation removes one player's entry from one leaderboard. On a Total Score board, that entry contains the player's accumulated score, so check your run records before deleting it over one bad run. In a November 13, 2026 patch note, the developer of Where's WigglyJiggly reported removing confirmed cheated scores and said the leaderboard had not been reset. Unity Admin API · Where's WigglyJiggly patch notes

How to Block Direct Writes in Unity Leaderboards

To block direct leaderboard writes in UGS, post scores from your backend and deploy an Access Control rule that denies writes from players. Search your Unity client for AddPlayerScoreAsync, the SDK call that adds or updates the signed-in player's score. Scope the policy to the board's score resource, with Principal set to Player, Effect set to Deny, and Write in the Action list. Unity's staff example shows the resource pattern for one board. The deployment guide covers the UGS CLI and the Editor's Window > Deployment view. Unity SDK score submission · Unity single-board policy example · Access Control deployment

For a player-facing Cloud Code C# module, use context.ServiceToken for the leaderboard write and context.PlayerId to identify the caller. The service token can write scores for a player other than the caller, so check that the run belongs to the caller before posting. Choose the board from the run's recorded challenge or mode. Test with a normal player account. A direct write should fail, and a valid result submitted through the module should appear under that player's name. Unity C# module example · Cloud Code execution context

If the game is live, try the oldest build you still support before deploying the restriction. A client that still relies on the old direct write will lose score submission when the rule takes effect.

What Can the Server Verify About a Score?

A score cap rejects impossible numbers. To verify a score within the cap, the server needs evidence from the run. In the example above, 30 targets worth 100 points each plus a bonus of up to 1,000 give a maximum of 4,000. A score of 3,900 passes the range check. To verify it, ask what the server knows about which targets were hit and how the bonus was earned.

For ranked runs that start online, have the server issue a run ID and store the player ID, challenge, and rules version. When the score arrives, check that the run belongs to the caller and apply the rules from that record. Unity's Cloud Code example matches the completed level to the one started and checks the score range. Cloud Save's Protected player data lets the owning player read those fields and reserves writes for the server. If the client supplies the target count and bonus at the end, adding them up only checks the arithmetic. Unity's level start and finish example · Cloud Save access classes

If you use mobile app attestation, the verdict can tell you about the app or device behind a submission, depending on the signal. You still need evidence from the run to verify its score. How app integrity checks fit alongside server validation

For a casual board with no prizes, a cap based on the game's rules, one accepted result per run, and a way to review suspicious entries are a reasonable starting point. In a 2020 Steam discussion about Mini Motorways, a developer described the risk of removing a legitimate score based on an unusual number. They proposed replaying the run from its map, seed, and actions and explained the difficulty of getting identical results across machines. Mini Motorways developer discussion

If rank determines who gets a prize, have the backend establish the score before the result qualifies. In a turn-based puzzle, it can start from a known board, apply the submitted moves under the saved rules, and score the resulting board. A successful check establishes that those moves could produce the score. For an offline mode, decide before release what makes a run eligible. If you require an online start for ranked play, explain that before the first move and still let players keep their offline personal bests.

How to Avoid Counting the Same Run Twice

Keep a record of each accepted result under its run ID. If the game retries, look up that run before posting again. When two requests try to process the same run in Cloud Save, use the existing record's write lock to prevent both from updating it on the same version. If a write conflicts, re-read the record before proceeding. Posting the score to Leaderboards is a separate write, so handle the case where that write times out after succeeding. Cloud Save write locks

The same retry problem comes up when the game crashes after granting a purchase reward and processes the order again on restart. How to avoid granting the same Unity IAP reward twice

Unity's Total Score strategy adds each posted score to the player's stored total. If the leaderboard saved an increment and the response was lost, posting it again can count the run twice. If your backend records each accepted run once, you can calculate the total there and post the full value to a Latest Score board, which stores the last score it receives. Keep writes in order for each player and have retries publish the current total. Unity Leaderboards update strategies

Pre-Release Checklist for Unity Leaderboards

Use a test environment configured like the live one. Check the stored score as well as what your game displays.

Test Expected result
Read the rankings as a normal player, then play a valid ranked run. The board loads and the accepted result appears under the right player.
Check direct write permissions with a normal player account. The score write is denied. The approved backend path can still post a valid result.
Test the legal maximum and one point above it under the same rules. In the example above, use 4,000 and 4,001. The maximum is eligible. The over-cap result stays off the board.
Test an in-range score with a missing run record, then with a start record but no evidence for the final score. The first submission fails if ranked runs must be recorded. The second stays out of a board that requires verified results.
Retry the same finish after the write succeeds but before the game receives the response. The player can recover the result and the run counts once, including on a cumulative board.
Start a ranked attempt offline. The game tells the player whether the run can qualify before play begins.
Finish a ranked run on the oldest build you still intend to support. The build can use the approved submission path, or it asks the player to update before starting ranked play.

Sources

← Back to list