Triggers, events & booleans
A boolean is a state, true or false, held until it changes. A trigger is an event, a single moment when something happens.
State against event
A boolean answers 'is it true right now?', like a light switch that stays on. It is a value you read every frame: a checkbox, 'is the runner inside the zone?', 'is the volume above the threshold?'.
A trigger answers 'did it just happen?', like a doorbell. It fires on the moment of change and is then gone: 'the runner entered the zone', 'the beat hit', 'the button was pressed'.
There is no separate trigger type. A trigger is a boolean caught at the instant it changes. That moment of change is an edge: a rising edge when something turns true, a falling edge when it turns false.
Rule of thumb: if you'd say 'while …', use a boolean (a held state). If you'd say 'when …', use a trigger (an edge/event).
The trigger button
Some parameters show a trigger button in place of a checkbox. Click it and it fires for a single frame, then resets itself: 'reset this feedback loop now', 'fire this burst now'. A checkbox stays where you leave it.
Turning one into the other
Boolean → trigger: detect the edge, the single frame where the value flips. The Compare node gives both a
result(the held boolean) and anedge(fires only on the frame the result changes).Trigger → boolean: remember it. Hold captures a value the moment a trigger fires and holds it until the next one. Which moment counts is its Edge setting: Rising when the trigger turns true, Falling when it turns false, Both for either, and Every Frame to keep sampling while it is held. A State Machine steps to its next state on each incoming trigger and stays there.
Which node does which
| Node | Gives you | State or event |
|---|---|---|
| Logic | AND / OR / XOR / NOT / NAND / NOR of booleans | State (no memory) |
| Compare | result (A vs B) + an edge that fires on change | Both: state and event |
| Conditional | routes data based on a condition | State |
| Hold | sample-and-hold: grab a value when triggered | Event in, value held out |
| State Machine | advances state on a trigger; fires on each transition | Event-driven |
| Trigger | which elements entered / are inside / exited a region | Event (enter/exit) + state (inside) |
| Collision Detect | the same enter/exit moments, for contact | Event |
Events need identity
'Entered' and 'exited' mean something only when an element can be identified from one frame to the next, which is what the @id attribute is for. Points from the Points node or a particle sim already carry one. Turn on Trigger's Track Identity, which is off by default, and it diffs that @id column frame to frame and reports exactly which element crossed the line rather than that something did. Left off, only inside and distance are meaningful. Collision Detect carries the same switch, on the same terms, for contacts rather than zones. See Attributes.
Triggers live in time, so they only make sense while playback is advancing. A paused graph never produces an edge, because nothing is changing frame to frame. See Time & playback.
See also
Time & playback for why edges happen between frames
Queries (sim-free) for region and contact events
Parameter widgets for the trigger button
Attributes for
@id, the identity that makes enter/exit possible