Skip to content

PrefabOverride

Defined in: prefab/types.ts:99

Override types applied to an entity in an instantiated prefab.

  • property — patch one field of one component. Requires: componentType, propertyName, value.
  • name — change the entity’s name. Requires: value (string).
  • visibility — change the entity’s visibility. Requires: value (boolean).
  • parent — re-parent a prefab-origin entity within the instance. Requires: value = the new parent’s stable PrefabEntityId, or null for “under the instance root”. Structural: applied by expandInstance / applyDeltaToSource (which own the id space), not by applyOverrides. The instance root is never re-parented this way — its attach point is the instance entry’s own parent.
  • component_added — add a component only if not already present (idempotent insert). Requires: componentData. Use this for variants that want to augment the base without silently stomping existing data.
  • component_replaced— upsert: replace the component’s data if the component already exists, or insert it if not. Requires: componentData. Use this when you explicitly want to override the base’s copy.
  • component_removed — delete the component if present. Requires: componentType.
  • metadata_set — set or replace one metadata key. Requires: metadataKey, value (any JSON-serialisable). Idempotent — applying twice is a no-op.
  • metadata_removed — delete one metadata key if present. Requires: metadataKey.

optional componentData?: PrefabComponentData

Defined in: prefab/types.ts:115


optional componentType?: string

Defined in: prefab/types.ts:111


optional metadataKey?: string

Defined in: prefab/types.ts:113


prefabEntityId: string

Defined in: prefab/types.ts:100


optional propertyName?: string

Defined in: prefab/types.ts:112


type: "property" | "component_added" | "component_replaced" | "component_removed" | "name" | "visibility" | "parent" | "metadata_set" | "metadata_removed"

Defined in: prefab/types.ts:101


optional value?: unknown

Defined in: prefab/types.ts:114