Log inGet started

preset

Updated 22 August 2026

The preset namespace — 2 functions.

globals/preset/create

preset.create(name: string, entityId: string, componentType: string, opts: PresetCreateOpts?) -> PresetCreateResult

Snapshot an existing component's public property table into a preset asset on disk. Bare names land under /source/presets/<name>.preset/preset.yaml; absolute paths must point to a .preset directory or its inner preset.yaml.

Parameters

  • name string — Either a bare preset name (lands under /source/presets/) or an absolute path to a .preset asset.
  • entityId string — Source entity id.
  • componentType string — Component to snapshot (e.g. "CharacterController").
  • opts PresetCreateOpts (optional) — Optional creation options (currently just { name = displayName }).

Returns PresetCreateResult — Metadata about the written preset: { path, entityId, component, properties }.

preset.create("my_locomotion", entityId, "CharacterController")

globals/preset/load

preset.load(source: AssetRef<preset>, overrides: table?) -> { [string]: any }

Load a preset asset and return the plain component property table.

Parameters

  • source AssetRef<preset> — Ref-like input that must resolve to a preset asset before the function body runs.
  • overrides table (optional) — Optional table merged onto the loaded properties.

Returns { [string]: any } — Plain table suitable for entity(id).component.add(type, data).

preset.load("@builtin::systems.characterController.presets.synty")
preset.load("/source/presets/my_locomotion.preset", { walkSpeed = 3.0 })
  • api
  • reference