Edit State Machines

Overview

The timeline panel includes a visual State Machine section.

Workflow

  1. Select or create a state machine.
  2. Add inputs (boolean | number | trigger) for transition conditions.
  3. Add states and bind each state to a timeline.
  4. Add transitions between states with duration, optional exit time, optional condition, and optional priority.
  5. Click a state or transition to edit it.
  6. Use Set Entry to choose the entry state.
  7. Use Play/Pause to test state switching.
  8. Use runtime input controls to set input values or fire triggers.

Edit Operations

  • Inputs: add, update, delete.
  • States: add, update, set entry, delete.
  • Transitions: add, update, delete.

Behavior Notes

  • Deleting a state removes transitions that reference it.
  • Deleting an input removes transition conditions that reference it.
  • State machine changes are persisted and included in undo/redo history.
  • If multiple transitions match at the same time, higher priority wins deterministically.
  • Runtime evaluation diagnostics are available through editor.animation.getStateMachineDiagnostics(machineId).

Script Integration

State machine runtime can drive script hooks through bindings (onRun, onStateChange).

Related pages: