menu_bookDocumentation
Prefab Instance Overrides
Prefab Instance Overrides
Customize individual prefab instances without affecting the original or other instances.
Types of Overrides
| Override Type | Description |
|---|---|
| Property | Change property values on GameObjects/Components |
| Component Addition | Add new components to the instance |
| GameObject Addition | Add child GameObjects unique to the instance |
Visual Indicators
- Prefab instances with overrides show indicators in hierarchy
- Overridden properties highlighted in inspector
Managing Overrides
Revert Override
Restore original prefab value:CODE
Right-click → Revert OverrideApply to Prefab
Update original prefab (affects all instances):CODE
Right-click → Apply to PrefabCommon Use Cases
- Same enemy type with different colors/sizes
- Props with varied orientations
- Buildings with different window configurations
Nested Prefabs
Overrides work hierarchically. Changes to nested prefab instances are stored on the outermost prefab instance.
CODE
Building (Prefab Instance)
└── Window (Nested Prefab) ← Override stored on BuildingIn Code
CSHARP
// Break from prefab (all overrides become permanent, link removed)
go.BreakFromPrefab();
// Check if instance has overrides
bool hasOverrides = go.HasPrefabOverrides;
Was this helpful?