
Reporting Results
Use the report-result call to tell the platform how a run ended. Every Game must call it, exactly once, when the run is over.
The Baseline Call
Unlike the game-ready signal and userData, reporting a result is not optional: every Game calls it. It ends the run and feeds the result screen, leaderboards, and activity. Your game is not scored unless you call it.
Signature
reportResult(result, options)
result(number | string, required): the outcome of the run.- A number feeds leaderboards and, for score/time Result Types (not Group), the game's result bands (see "How the Result Is Displayed" below).
- A string is shown as-is on the result screen; no leaderboards or star bands.
options(optional):{ flavorText?: string; userData?: string; delay?: number }.
import { reportResult } from '@minit-games/sdk'
// Numeric score
reportResult(4200)
// String result
reportResult('You escaped!')
Unlike the other SDKs, Unity's score is always a double. There is no string form. Use flavorText for a plain caption instead.
When to Call It
Call it once, at the moment the run ends: not per-frame, not repeatedly. The host ignores repeat calls for the same run.
function handleGameOver(score) {
reportResult(score)
}
The Flavor-Text Option
A short caption shown alongside the result on the result screen and in the activity feed. Highlight one memorable stat or moment from the run (a best combo, a close call), not the score itself or generic copy ("You won!").
reportResult(score, { flavorText: '3 enemies defeated in a row!' })
The userData Option
reportResult also accepts a userData string to persist per-player state alongside the result, written atomically with it. Omitting it leaves the stored value unchanged. Full model and limits: Saving User Data.
Unity's userData parameter and workflow are documented in Saving User Data, including the no-null GetUserData(defaultValue) semantics.
The delay Option
delay (milliseconds) holds the host's result screen back, useful when your game plays its own end-of-run animation first. Omit it to show the result screen immediately.
reportResult(score, { delay: 1500 })
How the Result Is Displayed
A numeric result is interpreted by the game's Result Type setting in the console (score, time, or group, plus a sort direction for score/time) and its result bands: the thresholds that map a result to a star rating on the play page. Set both on the game's edit page. Group-type games show no star rating. A string result skips the mapping and is shown verbatim (Unity has no string form; see "Signature" above).
Time results are seconds, not milliseconds
For a time Result Type, report the elapsed time in seconds as a plain number. Fractions are allowed (42.5); the platform displays whole seconds (42s, 1m 23s) and ranks on the exact value. Do not report milliseconds: reportResult(42500) is shown as 11h 48m 20s, not 42.5s.
// elapsedMs measured with performance.now() or Date.now()
reportResult(elapsedMs / 1000) // ✅ seconds
reportResult(elapsedMs) // ❌ milliseconds
The same rule applies to every engine facade (Minit.ReportResult, report_result, Minit.reportResult): the number is always seconds.
Outside the Host
In the Unity Editor and in non-WebGL builds, Minit.ReportResult() logs to the Console ([Minit] ReportResult(score, "flavorText", delay)) instead of talking to the host, so you can develop and iterate without a browser.
In the app, the call triggers the real result screen and leaderboard update. The Creator Console's web preview renders a simplified overlay instead, so you can confirm the result and flavor text without the app.
Deeper Dives
- Unity: the full Unity SDK setup walkthrough
- Game Ready Signal: call
Minit.LoadingDone()when your game finishes booting