Skip to content

API Interface FieldOptions

github-actions[bot] edited this page Nov 28, 2026 · 4 revisions

Interface: FieldOptions

Defined in: src/engine/core/registry.ts:115

Options on a declared field (ADR 0033, 0038, 0131).

Properties

animatable?

animatable?: boolean | readonly string[];

Defined in: src/engine/core/registry.ts:159

Whether an animation clip, timeline or tween may drive this field (ADR 0371, completing 0159); the Inspector offers key buttons only on animatable fields. Default: true for Number, Vector2, Vector3, Quaternion, Color, Boolean, a field with choices, and AssetRef; false for strings without choices, lists, plain objects and other types. Set false where animating would break an invariant, such as a physics body's bodyType, or true to opt a field in that the default leaves out.

On a PlainObject field, a list of sub-paths opts those in: animatable: ["targetPosition"] lets a clip drive spring.targetPosition (D86); the object as a whole stays not animatable. Each entry is a path below the field, keys joined by dots (["pose.position"] for a nested object), and names one leaf exactly: an entry doesn't open the keys below it. isFieldAnimatable(type, "spring.targetPosition") resolves it.


choices?

choices?: FieldChoices;

Defined in: src/engine/core/registry.ts:123

The values this field (or each item of a list field) may take; the editor shows a dropdown.


description?

description?: string;

Defined in: src/engine/core/registry.ts:146

One or two plain sentences saying what the field is for (ADR 0159). The editor shows it as the field's tooltip. Metadata only: not saved in scenes, not replicated, ignored at run time. A list field's description applies to the list, not to each item.


hidden?

hidden?: boolean;

Defined in: src/engine/core/registry.ts:133

Not shown in the Inspector, for fields another editor owns (ADR 0131). The field is still saved, loaded and replicated as usual.


kind?

kind?: 
  | AssetFieldKind
  | readonly AssetFieldKind[];

Defined in: src/engine/core/registry.ts:128

For an AssetRef field, or each item of an [AssetRef] list: the kind (or kinds) of asset it holds (ADR 0131). The editor offers only those. Only guides the editor.


predicted?

predicted?: boolean;

Defined in: src/engine/core/registry.ts:119

Roll back and re-simulate this field on the owning client (T13). Implies replicate.


quantize?

quantize?: number;

Defined in: src/engine/core/registry.ts:121

Send numbers rounded to this step (e.g. 0.01) to save bandwidth (T8, T11).


replicate?

replicate?: boolean;

Defined in: src/engine/core/registry.ts:117

Replicate this field from server to clients on replicated nodes (T11).


shownWhen?

shownWhen?: (values) => boolean;

Defined in: src/engine/core/registry.ts:140

Show the field in the Inspector only while this returns true, given the component's field values by name (shownWhen: (t) => t.gridShape === "hexagonal"): for fields that mean something only for some values of another. With several nodes selected, the field shows if it holds for any of them. Editor-only: the field is still saved, loaded and replicated as usual, whatever this returns. Should be a cheap, pure test.

Parameters

values

Readonly<Record<string, unknown>>

Returns

boolean


view?

view?: "radians" | "degrees" | "quaternion";

Defined in: src/engine/core/registry.ts:161

For a Quaternion field: how the Inspector shows it (ADR 0165; default: the editor's preference). Editor-only.

Clone this wiki locally