Skip to content

Hot Patch for Unity

Edit C# while Play Mode is running. See changes immediately, without waiting for Unity to recompile.

Hot Patch is a Unity Editor tool by DivinityCodes that lets you iterate on gameplay logic in real time. Save a .cs file in your IDE and the updated code runs on the next invocation, while your scene keeps playing, static state stays intact, and domain reloads are avoided.


Why Hot Patch?

Unity's default workflow interrupts your flow every time scripts change. A single typo fix can cost 30–60 seconds of compile time, and a full domain reload wipes Play Mode state you were actively debugging.

Hot Patch removes that friction:

Without Hot Patch With Hot Patch
Save → wait for compile → domain reload → re-enter Play Mode Save → patch applies in milliseconds
Lose running game state on every script change Keep Play Mode alive while you iterate
Re-test from scratch after each edit Re-invoke the changed method and verify instantly

Hot Patch is built for day-to-day Editor iteration: tuning gameplay values, fixing logic bugs, prototyping behaviors, and exploring ideas without breaking your concentration.


# Quick Start

  1. Import the Hot Patch Unity package.
  2. Open Tools → DivinityCodes → Hot Patch.
  3. Accept the license agreement in the Options tab.
  4. Press Start on the Home tab.
  5. Enter Play Mode.
  6. Edit a script in your IDE and save.

Your changes apply on the next method invocation. See Getting Started for details.


Key benefits

  • Instant feedback: Patches apply in milliseconds, even on large projects.
  • Play Mode stays alive: No domain reload; coroutines, timers, and scene objects keep running.
  • IDE-first workflow: Works with Rider, Visual Studio, VS Code, or any editor that saves .cs files.
  • Zero project changes: No code attributes or build steps required to get started.
  • Transparent logging: The Hot Patch window shows exactly what was patched, skipped, or failed.
  • Editor-only by design: A debugging and iteration tool, not a production runtime dependency.

How it works (at a glance)

  1. You enter Play Mode with Hot Patch enabled.
  2. Hot Patch blocks Unity's automatic script refresh so saves do not trigger a domain reload.
  3. When you save a .cs file, Hot Patch detects the change, compiles only what changed using Roslyn, and redirects method execution at runtime using Harmony.
  4. The next time your code runs Update, a button handler, a utility method, it uses the new logic.

No external server. No project setup. Import the package, open the window, press Start, and edit.


Requirements (summary)

  • Unity Editor with the Mono scripting backend
  • Play Mode (patching applies while the Editor is playing)
  • Runtime scripts under Assets/ (not Editor/ folders)

Hot Patch is not supported for IL2CPP player builds or shipped game binaries. See Requirements & Limitations for the full list.