# Editing prefab variants

The generated prefab variant is an authoring view of a patch. Edit it with Unity's normal prefab tools; the Redux SDK converts supported overrides into patch operations when you save.

## Changes that map naturally

The visual compiler handles the changes modders usually need:

* serialized values on existing or added components
* Unity object references
* active-state changes
* added GameObjects and child hierarchies
* added components
* removed components
* suppressed stock GameObjects

A removed stock GameObject is represented as suppression: the effective prefab keeps the object but disables it. This is safer for other patches that may still target it.

## Adding GameObjects

Every GameObject added by your patch must have a `PrefabPatchAuthoringObjectId` component with a stable, non-empty ID.

Choose an ID that describes the object's role, such as `status-icon` or `extra-engine-audio`. The ID is local to this patch. Keep it stable after release, even if you rename the GameObject, because other operations and other mods can address it.

Nested added objects need their own IDs when anything must target them directly.

## Adding components

Add components normally in the Inspector. Components from game assemblies and mod assemblies are supported as long as the component type exists in the running installation.

If your patch adds a custom component, your assembly must load before the prefab is composed. Declare the normal mod dependency for any component owned by another mod.

## References

You can assign:

* another object or component in the same effective prefab
* an object from a linked Addressable
* an explicit mod-owned Addressable asset

Use linked assets for stock textures, materials, audio, prefabs, and other game assets. Use ordinary Addressables entries for assets that your mod owns.

A loose project asset that is neither linked nor an Addressables entry cannot be resolved by the game and causes compilation to fail.

## Saving and compiling

Leave **Auto Compile On Save** enabled for normal work. Saving the prefab variant updates the JSON manifest. If compilation fails, the Console and metadata Inspector list each unsupported or unresolved override.

Do not edit the generated JSON as your source. The next prefab save will replace it. Change the variant or its metadata instead.

## Effective preview

The effective preview applies every known patch for the target, not only the current variant. Use it to verify that ordering and cross-patch references produce the expected final hierarchy.