Live patching & C# hot-reload

Change the code. Keep the match.

Agents patch edited method bodies into the running Play Mode session, so a one-line fix doesn't cost you the scene or the bug you just reproduced.

Why it matters

  • No minute-or-two reload. The usual loop is stop Play Mode, compile, reload the domain, press Play, replay your way back. On a mid-size project that's a minute or two, and an agent that writes five fixes pays it five times.
  • The scene survives. Method bodies are patched into the running Mono domain, so objects and connections stay and the new code runs the next time the method is called.
  • Four editors, one patch. The primary's hot-reload reaches every multiplayer clone, so you don't relaunch four players.
  • Tune the live game. A jump curve changes in a match that never stopped, and an agent does the same: save the file, call its handle again.

It covers method bodies in Assembly-CSharp, your asmdefs and embedded packages, whether you edit in the editor or an agent writes to disk. Agents arm it with hotReload: true on unity.play, the same toggle the Player panel has. It needs Unity 6 on Mono.

The limit: new fields, methods and types, and changed signatures, still need a normal recompile. A patched Awake or Start only affects objects spawned afterwards.

For the rest of the live scene, unity.exec in the Unity MCP server runs C# in the session through Roslyn: spawn objects, change values, call your handles. In the clip above, two prompts recolor the lights and set the monolith spinning while Play Mode keeps running.

Straight answers

Hot-reload questions.

What exactly can hot-reload change in Unity?

Method bodies, during Play Mode, on Unity 6 (Mono), in Assembly-CSharp, asmdefs and embedded packages. New fields, methods and types need a normal recompile.

Does hot-reload work with IL2CPP?

No, it needs Mono, which the editor uses. Your IL2CPP player builds are unaffected.

Do multiplayer clones get the patch too?

Yes. The clones hot-reload with the primary.

Related

Stop restarting to test one line.

Patch the running game and keep the state.

7-day free trial (no card required)macOS & Windows