Attack with cooldown
Gate the attack branch on a countdown your own component owns, so the graph never keeps a second copy of the timer.
On this page
The component that refuses the swing is the component that should be timing the wait.
The problem
Section titled “The problem”An enemy should swing, then wait, then swing again. If the graph owns the wait, you have two timers: the one in your combat component that decides whether the hit lands, and the one in the graph that decides whether to try. They drift, and the enemy swings at nothing.
The shape
Section titled “The shape”Keep the countdown in the component. On a fresh Attack Sequence entry, check distance, contact range, and cooldown before starting a flurry.
HordeEnemy.bqbehavior runs an Enemy Decisions Selector under repeat forever. It tries Death, Attack Sequence, Chase Sequence, then Wander. Distance Squared Precheck calculates distance_sq_precheck; In Contact Radius Precheck tests it against ContactAttack.RadiusSq; Cooldown Ready Precheck reads ContactAttack.CooldownRemaining and tests ≤ 0. If a precheck fails, Attack Sequence fails and the Selector tries pursuit or wander. Once the prechecks pass, Reset Attack Tally clears attacks_landed and the three-grant Attack Flurry begins. The inner Until Ready guard rechecks distance and cooldown before each counted grant.

The countdown already lives in a component, so the graph reads it as a fact instead of keeping a second clock.
Nodes it uses
Section titled “Nodes it uses”- Selector with death, attack, chase, and wander branches in that order.
- Sequence for Attack Sequence, so the first failing precheck ends a fresh attempt.
- Member condition reading
ContactAttack.CooldownRemainingbefore a new flurry and again between its grants. - Method for the static distance calculation that the contact-range checks compare against.
Reuse it
Section titled “Reuse it”Put the countdown where the ability already lives, so the component that refuses the swing also measures the wait. Place the cooldown precheck before the flurry; inside a flurry, check it again before each grant. Attack Flurry counts real grants, not the frames spent waiting between them.
- Director with weighted choices: the graph that decides what this enemy is part of.
- Horde Survival chapter: entity agents, and how to play it.