Files
aego/engine/res/docs/prefabs.md
sanspie 50be5c04bc
ci-platforms / darwin amd64 smoke (push) Skipped
GitHub / linux amd64 native GitHub-hosted native CI: success
ci-platforms / windows amd64 smoke (push) Skipped
GitHub / windows amd64 native GitHub-hosted native CI: success
GitHub / darwin arm64 native GitHub-hosted native CI: success
GitHub / darwin amd64 native GitHub-hosted native CI: success
ci / checks (push) Failing after 1h21m34s
ci / native-authoring (push) Skipped
ci-platforms / darwin arm64 smoke (push) Skipped
github-native / gitea-pending (push) Skipped
github-native / darwin amd64 native (push) Skipped
github-native / linux amd64 native (push) Skipped
github-native / windows amd64 native (push) Skipped
github-native / darwin arm64 native (push) Skipped
github-native / gitea-result (push) Skipped
ci / build (amd64, linux, ubuntu-24.04) (push) Successful in 12m4s
ci / release (push) Skipped
Stage 12.5: Art Workspace and asset authoring
Add dockable Art tools, animation and previews, guarded asset workflows,
and the Web Asset Studio built on the shared Art Core. Expand English and
Russian documentation, interactive Try scenes, examples and editor icons.

Add audio waveform navigation, source analysis, guarded previews and a
browser Worker mixer. Preserve source changes and recovery with bounded
checks, and strengthen native, browser and interoperability CI.

Prepare version 0.12.5 and manually built native artifact candidates.
Fix the production site image demo build dependency.
Reuse immutable scene indices when capturing keyframes.
Wait for real Persist save/load completion in component tests.
Stabilize browser Game View captures outside pointer hover.
Aseprite interchange and persistent Audio EDL recovery remain limited;
the artifact workflow does not publish releases or change stable.
2026-11-15 10:37:50 +03:00

3.0 KiB

id, icon, group, title, order
id icon group title order
prefabs file.prefab scenes Prefabs 1

Prefabs

A prefab instance selected in the Hierarchy: the orange cube marks instances

A prefab is a reusable piece of a scene stored in an .aeprefab file. Every copy in a scene is an instance: it shows the prefab and keeps its own changes, the overrides. When the prefab changes, every instance follows it, and its overrides stay.

Try the lamp instances to see several copies with different overrides.

Create and place

Prefab mode: the prefab opens on its own, with a breadcrumb back to the scene

  • Drag a node from the Hierarchy onto a folder in Assets, or use Hierarchy → Prefab → Create Prefab. The node becomes an instance of the new prefab and keeps its node ids, so references to it keep working.
  • Drag an .aeprefab into the Hierarchy or the Scene View, or use Instantiate in Scene from its context menu.
  • Open a prefab with a double click or Prefab → Open Prefab. Saving it updates every open instance in one step that can be undone from any of those scenes.

Overrides

Any change to an instance is an override: a property, an added or removed component, an added or removed node, the order of children. The position, rotation and scale of the instance root are always the instance's own.

  • The Hierarchy marks instance roots with the prefab icon and nodes you added with a plus.
  • The Inspector marks overridden properties with a bar on the left and added components with an added badge. The Prefab card on top has Apply All, Revert All and Open.
  • Right click a property, a component or a node to apply it to the prefab or revert it.

Nodes that come from a prefab keep their parent inside an instance. Unpack the instance to move them.

Nested prefabs and variants

A prefab can contain instances of other prefabs. When you apply a change made inside a nested instance, choose where it goes: the nested prefab itself, or the outer prefab as an override of its nested instance.

A variant is a prefab whose root is an instance of another prefab: Prefab → Create Variant. It changes what it overrides and follows its base everywhere else.

Unused overrides

When a prefab loses a node or a component that an instance overrides, the override is kept and listed under Unused overrides in the Prefab card. It does nothing until you remove it. Problems shows it as PFB002.

Missing prefabs

If the prefab file is gone, the instance loads as an empty node named after it and is saved back unchanged. Problems shows PFB001. Play is not blocked.

Unpack

  • Unpack turns the instance into plain nodes; prefabs nested in it become instances of their own.
  • Unpack Completely turns everything into plain nodes.

Scripts

scene.Instantiate(prefab, parent) creates a copy at runtime. The copy has fresh node ids, and references inside it point into the copy.

node.IsPrefabInstance() reports whether a node is a prefab copy or lies inside one. node.PrefabRoot() returns the root of that copy.