In this lesson, you will learn how to identify and resolve logic errors caused when deep prefab nesting or nested overrides create unexpected property behavior.
The Conflict Dilemma
When you work with nested prefabs (a prefab inside a prefab), tracking which value is controlling a specific property can become confusing. A "conflict" occurs when a child prefab has an override that is being hidden or overwritten by a parent prefab's configuration, or when you aren't sure if a change exists on the prefab asset itself or just the current scene instance.
Diagnostic Techniques
When an object isn't behaving as expected—such as a physics-enabled door not triggering a sound—use these three steps to isolate the issue:
- Check the "Blue Line" Indicators: In the Inspector, Unity highlights properties that have been overridden with a blue bar on the left. If you see a blue bar on a nested component, hover over the property to see if it was modified in the local instance or inherited from a base prefab.
- Isolate with Prefab Mode: Open the specific nested prefab by clicking the arrow next to its name in the hierarchy. By isolating it, you can see if the property is correct in its "source" state. If the behavior works in isolation but fails in your scene, you know the conflict is coming from a higher-level override.
- The "Revert" Test: If you suspect a conflict, right-click the component header in the Inspector and select Reverts for specific properties. This forces the component to match the prefab asset. If the bug disappears, you’ve confirmed that an accidental override was the culprit.
Example: Nested Overrides
Imagine a BaseDoor prefab that has a HingeJoint with a 90-degree limit. If you create a HeavyDoor variant, you might override that limit to 45 degrees. If a scene instance of HeavyDoor isn't moving correctly, checking the Inspector for that blue override bar tells you immediately that someone—or something—modified the default physics constraints.
Key Takeaway: Use the Inspector’s blue override bars and Prefab Mode to isolate whether a property conflict stems from the base asset or an unintended change in a nested instance.