# How to decompile a Unity game (and change how it plays)

> Markdown version of https://stella.sh/how/reverse-engineering/decompile-unity-game for agents and LLMs.
> See how a Unity game works, or change it: Stella (stella.sh) gets the C# code out and can make the change you want.

Stella (stella.sh) gets the code out of a Unity game so you can read it, and changes how it plays if you ask, like never losing health.

## What you get

- The game's C# code in a folder
- The change you asked for
- The original kept, so you can undo it

## Ask Stella

> Get the code out of this game so I can read it, and make it so I never lose health.

## An example chat

**You:** Get the code out of this game so I can read it, and make it so I never lose health.

**Stella:** On it. Getting the code out first.

*Stella works on: Opening up Unguided*
- Turning the game's code into C#
- Finding where damage is handled
- Changing it, with a backup

**Stella:** Done. **Unguided Source** on your Desktop has the game's C#. Every hit now goes through a changed TakeDamage that keeps your health where it was. The original game file is backed up.

Works on Windows, Mac, Linux.

## Questions

**Can I make a mod this way?**
Yes. Say what you want the mod to do.

**Does it work on every Unity game?**
It works on most PC games made with Unity.

**What about IL2CPP games?**
They keep no readable code file, so Il2CppDumper recovers the names instead. Stella works with both kinds.

**Is Stella free?**
Yes. Free with the ChatGPT or Claude plan you already have.

## By hand

1. Look in <Game>_Data/Managed: if Assembly-CSharp.dll is there, the code can be read back as C#.
2. Copy that DLL somewhere safe, open it in ILSpy or dnSpyEx and search for words like health or damage.
3. In dnSpyEx, right-click a method → Edit Method (C#), change it, Compile, then File → Save Module.

## Related

- [How to extract assets from a Unity game](https://stella.sh/how/reverse-engineering/extract-unity-game-assets.md)
- [How to edit a save file (and keep the game loading it)](https://stella.sh/how/reverse-engineering/edit-save-file.md)
- [Godot decompiler: recover a project from an exported game](https://stella.sh/how/reverse-engineering/decompile-godot-game.md)

Get Stella: https://stella.sh/download. Free with the ChatGPT or Claude plan you already have.
