Any State
Put the handoffs that hold from every mode in one ordered list instead of copying the same edge onto every state.
On this page
Death, a level reset, and a klaxon do not care which mode the actor is in. Any State holds those rules once, for the whole machine.
The problem
Section titled “The problem”You add a fourth mode to a guard and now you owe it the same “the level reset, go back to the start” edge that the other three already have. Miss one and the guard keeps patrolling through a reset. Copy it four times and the next change is four edits, with four chances to leave one behind.
DocumentationStateControls.bqbehavior keeps that rule in one place. Its Any State owns a transition called reset patrol whose predicate is reset_requested == true, and it holds from patrolling and from chasing without either state carrying an edge for it.
When to reach for it
Section titled “When to reach for it”- A death, defeat, or shutdown mode that has to win from anywhere.
- A level-wide reset like the Platformer fixture’s patrol reset.
- One alarm shared by every mode of a machine, where the destination is valid no matter which mode was live.
See it: the global rule taking over
Section titled “See it: the global rule taking over”
DocumentationStateControlsLive.bqbehavior runs the same shape while the game is playing. The reset row wins from the mode that happens to be live, and the rail’s Precedence card shows why the order matters: the Any State subheading lists reset patrol as row one, and the patrolling subheading lists that mode’s own player spotted as row two.

-
Open
Assets/Platformer/Behavior/DocumentationStateControls.bqbehaviorand find the dashed Any State plate below the ordinary modes. -
Select it. The rail names it Any State, and its name is fixed, so there is nothing to rename. It has no Entry, no Active Update, no Exit, no Completion. The first line of its rail states its whole job: “These transitions are checked before the active state’s own list. A row targeting the active state is skipped.”
-
Select the transition reset patrol that leaves it. Its Trigger compares
reset_requestedwith true, and its destination ispatrolling. -
Read the Evaluate card. When offers Continuous alone, and the line under the control explains why: Any State has no Active Update whose finish or pass could arm a row.
-
Read the Precedence card on that rail. Put the most urgent rule first, because the first matching row wins before any local row is considered.

How it decides
Section titled “How it decides”Where it sits in the update
The active machine’s Any State rows are scanned before the active state’s own rows, in authored order, at the boundary that opens every update and again right after Active Update produces a terminal result. The first match wins and at most one transition fires per update.
A row whose destination is already the active mode is skipped. That is what keeps a predicate that stays true from restarting its own destination every update, and it is why there is no “can re-enter” toggle to find.
What Any State is and is not
- It is never entered and never reported as the active mode, so it produces no result.
- It owns no Entry, Active Update, Exit, Run, Lifetime, or Completion. Authoring refuses lifecycle work or semantic parameters on it.
- A machine may hold at most one of them, connected to its root by exactly one containment edge, and it may source only transition rows.
- Each composed machine owns its own. A referenced child machine uses its own Any State list while the child is active; it does not borrow the parent’s rows, and the parent does not reach into the child’s.
Firing behavior
An Any State Switch cancels the work the active mode owned, gives that mode its one Exit update, then runs the destination’s Entry. An Any State row can also be a Push, which suspends the current mode for a later Return instead of ending it.
Keep the list short
A broad global row preempts every local rule and every mode’s work. It earns its place when the predicate and the destination are both valid from every mode the machine can be in. If a rule matters in one mode, keep it on that mode. If two modes share it and five do not, two local rows say more about your design than one global row does.
When it goes wrong
Section titled “When it goes wrong”When it goes wrong
| Symptom | Check | Fix |
|---|---|---|
| The global rule wins in a mode where it should not. | Read the predicate and ask whether it is true in modes you did not think about. | Narrow the predicate, or move the row back onto the modes where it belongs. |
| A local transition never gets a turn. | Read whether an Any State predicate stays true while that mode is active. | Any State is scanned first by design, so make its predicate an event-like edge that goes false again. |
| The destination restarts every update. | Confirm the row really leaves from Any State and not from the destination itself. | An Any State row aimed at the active mode is skipped; a local self transition is not, so read its Re-entry card. |
| Authoring refuses a second Any State. | Look for one already on the canvas, possibly scrolled out of view. | A machine holds one. Add the extra rows to the existing plate. |
| The Evaluate card offers no On finish. | Read the reason line under the control. | Nothing to repair. Any State rows are Continuous, so move finish-shaped rules onto the state that owns the work. |
- Transitions: cadence, triggers, and the full order of the scan.
- Push and Return: a global interrupt that gives the mode back.
- Any State reference: the rail, field by field.