Skip to content

Prefabs (Object Blueprints)

Opal stores reusable object templates in the asset library as prefabs (kind: "blueprint"). They are snapshots — not live-linked proxies — with an optional weak assetLibraryId link for override detection.

Save a prefab

  1. Configure an object (components, motion, Object Flow graphs).
  2. Inspector → ActionsSave as Prefab.
  3. The prefab is stored in the Blueprints asset folder with components, motion, and graphs.

If the object has children, the full subtree is captured automatically.

Place or spawn

  • Asset library: click a .blueprint asset to place an instance in the scene.
  • Object Flow: use the Spawn Object action and pick a prefab from the dropdown.

Both paths use the same instantiate pipeline (instantiatePrefab) and restore graphs onto the new instance.

Overrides

Linked instances show override dots on changed scalar fields (name, size, rotation, opacity, group, tap action, network sync). Component field overrides appear in the linked prefab panel with per-field reset.

  • Revert Prefab Overrides resets all scalar and component fields to the template.
  • Update Prefab writes the current instance back to the linked asset.
  • Prefab sync: auto instances pick up non-manual refreshes when the prefab asset is updated; manual instances keep their overrides until you revert.

Variants

Save as Prefab Variant creates a blueprintVariant asset that stores only a diff (baseBlueprintId + overrides) against the instance's linked prefab.

Bundled prefabs

New installs seed demo prefabs from bundled/blueprints/ via bundled/asset-manifest.json:

  • Slime Enemy
  • Gold Pickup
  • Enemy Spawner (timer → spawn slime)

Opal Engine — MIT licensed