Appearance
Prefabs
A prefab is a saved object — one GameObject plus all of its children — that you can place in a map as many times as you like. Editing the prefab updates every copy already placed.
Galatrix uses the classic Unity prefab model: one flat level, no nested prefabs. A prefab cannot contain another prefab as a linked child; drop one inside another and you get plain objects.
Creating one
Select an object in the Hierarchy and use Create Prefab — the object and everything parented under it is saved as a prefab asset in the Project panel, including its components and any scripts attached to it.
Placing one
Drag the prefab from the Project panel into the viewport, or right-click it → Instantiate. Each copy is an instance: a normal object tree that remembers which prefab it came from.
Editing the prefab
Two ways, both of which push the change to every instance:
Right-click the prefab → Edit Prefab. A copy of the prefab appears in the scene and a banner shows Editing prefab <name>. Change anything — components, child transforms, add or delete children — then press Save to write it back and update every instance, or Cancel to throw the edits away. The copy is scratch: it is removed either way, and it is never written into your map, even if you save mid-session. Use this when the prefab has no instances placed, or when you don't want to disturb one.
Or edit an instance and press "Apply to Prefab". Select any instance root; the Inspector shows the prefab link, an override count, and Apply to Prefab / Revert. Apply pushes that instance's whole tree into the prefab and on to its siblings.
Both are a single undo step: Ctrl+Z after an Apply or a prefab Save puts the prefab and every instance back exactly as they were.
Prefab editing is an edit-mode job — the controls are hidden while the game is playing, because Play resets the scene when you stop and the instances would silently disagree with the prefab.
Overrides
Change something on one instance and it becomes an override on that instance — Galatrix tracks these per property, the way Unity did:
- A value you have not touched follows the prefab whenever the prefab changes.
- A value you have changed is yours and is left alone by prefab edits.
- Overrides are per property, not per component: recolouring one instance still lets it pick up a roughness or scale change made to the prefab later.
- Deleting a component from an instance counts as an override — a prefab edit won't bring it back.
The Inspector lists what you've overridden (Kid.meshRenderer.color means the child named Kid). Revert drops that instance's overrides and takes the prefab as-is.
References inside a prefab
If one object in a prefab points at another — a car body naming its wheels, a joint chain, a Look At target, a script field holding an object — each placed copy points at its own objects. Two cars never share a wheel, and applying an instance back to the prefab converts those references back to prefab-relative ones. References that point at something outside the prefab (an existing object in the scene) are left alone, so every copy still points at that one shared object.
Placement is always per instance
The instance root's position, rotation and scale are never propagated — that is where that copy sits in the world. Child transforms are prefab data, so moving a child in the prefab moves it in every instance.
Editing the root transform inside an Edit Prefab session does change what the prefab stores, so future instances are placed with it; instances already in the scene keep their own placement.
Older maps
Maps saved before per-entity prefab links existed only recorded the link on the instance root, so prefab edits could not reach the children. Those instances are matched by tree position on the first sync and re-linked automatically — no action needed, and nothing is added or removed in the process.