unity-debug-runtimelisted
Install: claude install-skill Xenoneqq/unity-ai-skills
# Debugging a Unity game at runtime
**Evidence before theories.** A Unity bug reads like three plausible stories at once, and
reading code picks whichever one you thought of first. Get a fact, then pick.
Four moves, in this order: **reproduce → locate → narrow → confirm.** Skip the reproduce and
you cannot tell a fix from a coincidence. Skip the confirm and you never find out which it was.
This is the half [`unity-agent-worker`](../unity-agent-worker/references/verification.md) leaves
open: its ladder says *whether* something is broken, this says *why*. What the code should look
like afterwards is [`unity-coding-habits`](../unity-coding-habits/SKILL.md).
## 1. Name the symptom before touching anything
Profiling a logic bug and reading stack traces for a frame-rate bug both find nothing.
| Shape | Looks like | Start at |
|---|---|---|
| It throws | Red in the console, a stack trace | §3, §4 |
| It misbehaves quietly | Wrong value, nothing happens, nothing logged | §2, then §5 |
| It is slow | Low frame rate, stutter, climbing memory | §6 |
| It dies | Process gone, no managed trace | §3 — the crash file, not the console |
## 2. Make it reproduce, before reading any code
Write the steps down and run them three times. Three out of three is a bug; one out of three is
an observation, and the next move is to make it deterministic, not to start guessing.
- **Seed the randomness.** `Random.InitState(seed)` at startup; save and restore `Random.state`
around anything that mu