# Prefabs

Prefab patches let mods change Unity prefabs without distributing replacement copies. Several mods can patch the same stock prefab: Patch Manager resolves their requirements and order, applies their operations to one effective prefab, and reports conflicts or invalid targets.

## Guides

* [Getting started](/doc/getting-started-dU5nKhwSQP) explains the model and walks through a first visual patch from linked stock prefab to packaged manifest.
* [Visual authoring](/doc/visual-authoring-nYu5hKptCs) covers supported prefab overrides, stable IDs, references, dependencies, and ordering.
* [Code authoring](/doc/code-authoring-n5C0z3xYZ6) covers the C# and Lua frontends.
* [Compatibility and troubleshooting](/doc/compatibility-and-troubleshooting-mYFEDecmIr) explains preview, diagnostics, `pm_summary.log`, and common failure modes.

## The normal workflow


1. Create a [linked Addressable](/doc/linked-addressables-xRFosY6CNr) for the stock prefab.
2. Create a prefab-patch variant from that link.
3. Edit the variant in Unity and save it.
4. Preview the effective prefab.
5. Build and deploy the mod normally.
6. Open a campaign that has your mod on. Test the content that instantiates the prefab, and examine `pm_summary.log`.

---

**Documents**

- [Getting started](https://docs.ksp2redux.org/s/0a4a3e31-0b40-48e0-bd81-e14856f80d3d/doc/getting-started-dU5nKhwSQP)
- [Visual authoring](https://docs.ksp2redux.org/s/0a4a3e31-0b40-48e0-bd81-e14856f80d3d/doc/visual-authoring-nYu5hKptCs)
- [Code authoring](https://docs.ksp2redux.org/s/0a4a3e31-0b40-48e0-bd81-e14856f80d3d/doc/code-authoring-n5C0z3xYZ6)
- [Compatibility and troubleshooting](https://docs.ksp2redux.org/s/0a4a3e31-0b40-48e0-bd81-e14856f80d3d/doc/compatibility-and-troubleshooting-mYFEDecmIr)