# Glitchless for Unity

> Glitchless (glitchless.gg) is a free, open-source package for Unity 6.3 LTS and later. It records frame times with each hitch's cause (GC, shader compiles, scene loads), errors, player bug reports and where players quit, and gives coding agents the same data over MCP.

Website: https://www.glitchless.gg/unity.html · Read the package guide: https://github.com/glitchless-gg/glitchless/blob/main/unity/Packages/gg.glitchless.sdk/README.md

A package that records how your Unity game runs for the people playing it: every stutter with its cause, every error with what led to it, and where players quit. Your coding agent reads the same data over MCP and fixes what they hit.

## What it records in a Unity game

- **Stutters, with a cause.** Every frame is timed, with where the time went: physics, your `Update` code, rendering, the GPU. Each hitch names its likely cause: a garbage collection, a shader compile, a scene load, a burst of new objects or long script work.
- **Errors.** Uncaught exceptions, `Debug.LogError`, assertions and engine errors, grouped into issues with the game events just before each one.
- **Bug reports from playtesters.** F8, or your own button, opens a short form. The report carries the player's note, a screenshot, where they were and what had just happened.
- **Levels, deaths and quits.** Scenes are levels on their own. Deaths, fails and quits feed the level funnel, death heatmaps and rage-quit detection.
- **Leaks.** Mesh, material, texture and object counts at each level load in development builds, so a count that only climbs stands out.
- **Retention and revenue.** Install mode adds a saved random player ID for D1, D7 and D30 retention. Purchases add up to revenue and conversion.

## Set it up

One call in the first scene, or a Bootstrap component with the same three fields.

1. Package Manager → + → Add package from git URL, and paste the package's URL.
2. Call `Glitchless.Init` in the `Awake` of your first scene.
3. Press Play: Editor and development sessions show on your dashboard as `dev`.

Package URL, then Init:

```csharp
// Package Manager → Add package from git URL:
// https://github.com/glitchless-gg/glitchless.git?path=unity/Packages/gg.glitchless.sdk

using GlitchlessSdk;

Glitchless.Init(new GlitchlessOptions
{
    Service = "my-game",
    Intake = "https://api.glitchless.gg",
    ClientToken = "gl_pub_...",
});
```

## Built for working with a coding agent

Glitchless's MCP server gives Claude Code, Codex, Cursor or any other agent the findings, frame times, errors and bug reports from your players, so it can find what to fix and check the result.

A built player measures itself for an agent: `--glitchless-measure=10` prints frame-time percentiles and hitches as JSON and quits, for a before-and-after comparison. In the Editor, `Glitchless.Measure` does the same from code.

The Fetch! sample (Package Manager → Samples) is a small runner with an autoplay bot and four planted bugs to try it on.

## Tested

- EditMode tests check the frame-time sketch and error fingerprints bucket for bucket against the JavaScript SDK.
- PlayMode tests cover the runner and the bug report form.
- An end-to-end test builds the sample and checks what arrives at a local server.

## Not yet

- GPU time needs Player Settings → Frame Timing Stats.
- Mesh, material and texture counts come from Unity's profiler counters, which only development builds fill in.
- IL2CPP stacks show method names unless IL2CPP Stacktrace Information includes file and line.

## Frequently asked questions

### Which Unity versions does it support?

Unity 6.3 LTS and later, tested on 6.3 LTS and 6.5.

### Is it free?

The package and the server are open source under the MIT licence. Glitchless Cloud is free for 5,000 play sessions a month, or you can run the server yourself with Docker. See [pricing](https://www.glitchless.gg/pricing.md).

### Does it replace Unity Analytics?

It covers custom events, funnels, retention and revenue, with performance, errors and bug reports in the same place. [Glitchless vs GameAnalytics](https://www.glitchless.gg/glitchless-vs-gameanalytics.md) compares it with a dedicated game-analytics tool.

### What does it send about players?

Nothing that identifies them by default: no player ID, no device identifier, coarse device facts only. Install and full modes are opt-in, and [PRIVACY.md](https://github.com/glitchless-gg/glitchless/blob/main/unity/Packages/gg.glitchless.sdk/PRIVACY.md) lists every field.
