Cancel running action when reaction fires (default: true)
Block actions via tags
To prevent new actions during a reaction, add SEC.Action.BlockActions to AddTags. This is checked in PassesHardGates() on the action side, so blocked actions won't even be evaluated.
EvaluateBestReaction(CategoryTag):
1. Filter by CategoryTag (skip if empty)
2. Gate checks per reaction:
- Is enabled?
- Off cooldown?
- Under MaxConsecutiveUses?
- SEC.Reaction.BlockReactions not on ASC?
- All RequiresTags present?
- No BlockTags present?
- Custom Gates pass?
3. Custom Scorers scale each survivor's weight, then group by Priority (highest first)
4. Weighted random pick among the top-priority group
→ FChosenReaction { ReactionId, AbilityTag, Priority, Weight }
Your reaction ability must inherit from UGameplayAbilityBase. It handles the end-event handshake that tells the system when the ability finishes. Without it, the AI gets stuck waiting until timeout.
ExecuteReaction("Parry", Context)
├── 1. Validate gates (enabled, cooldown, BlockReactions, RequiresTags, BlockTags)
├── 2. Cancel current action (if bCancelCurrentAction)
├── 3. Apply AddTags to ASC
├── 4. Pack FSECExecutionContext into FGameplayEventData
│ ├── Auto-populate InstigatorTags from instigator ASC
│ ├── Auto-populate TargetTags from target ASC
│ └── TargetData passed through directly
├── 5. Activate ability (ByEvent or ByTag)
├── 6. Start cooldown, record use
├── 7. Fire OnReactionStarted
└── Listen for: AbilityEndTag event OR AbilityTimeout
└── CompleteExecution
├── Remove AddTags from ASC
└── Fire OnReactionCompleted
The reaction commits its cooldown only after the ability activates (step 6 follows step 5), so a CanActivateAbility that refuses the activation leaves the reaction off cooldown. That override can read the hydrated GetActionContext() payload to make its decision. See Gate Before Activation in the Action System.
No dedicated flag needed. Use AddTags and BlockTags for full control:
Reaction A (Parry):
AddTags: [SEC.State.ReactionActive]
BlockTags: []
Reaction B (Dodge):
AddTags: [SEC.State.ReactionActive]
BlockTags: [SEC.State.ReactionActive] ← can't fire while Parry is active
To block all reactions globally (e.g., during stun), apply the SEC.Reaction.BlockReactions tag to the ASC. This is checked inside PassesReactionGates() before any per-reaction tag check.
To make a weapon provide reaction sets, implement ISECWeaponReactionSetProvider on your weapon actor:
// Your weapon actor implements ISECWeaponReactionSetProviderUReactionSet* GetWeaponReactionSetForRole(FGameplayTag RoleTag) override{ // Return a role-specific reaction set, or a single set for all roles return MyWeaponReactionSet;}
// Tell the pawn about the weapon:Pawn->ReactionSetComponent->SetEquippedWeapon(WeaponActor);// Clear to revert to Config-based resolution:Pawn->ReactionSetComponent->SetEquippedWeapon(nullptr);
Create Asset: Right-click → Miscellaneous → Data Asset → ReactionSet
Define Reactions: Fill in ReactionId, AbilityClass, AbilityTag, AbilityEndTag
Assign to Config: Set DefaultReactionSet on your EnemyAIConfig, or add role-specific sets to RoleReactionSets
Pawn Component: If using EnemyCharacterBase, SECReactionSetComponent is already created. Otherwise, add it to your pawn.
Controller Component: Add ReactionEvaluationComponent to your AIController (already present on EnemyControllerBase)
Trigger from your logic:
// In your Blueprint or C++ (e.g., OnDamageReceived):FSECExecutionContext Context;Context.Target = DamageInstigator;Context.Magnitude = DamageAmount;Context.EventTag = SEC_Stimulus_MeleeHit;Context.TargetData = USECTargetDataLibrary::MakeTargetDataFromDirection(HitDirection);FChosenReaction Chosen = ReactionComp->EvaluateBestReaction(SEC_Reaction_Defensive);if (Chosen.IsValid()){ ReactionComp->ExecuteReaction(Chosen.ReactionId, Context);}
Context reuse
FSECExecutionContext is the same struct used by actions. If you're already familiar with ExecuteActionWithContext(), reaction context works identically: same fields, same auto-population, same TargetData library.
Working example included
Open BP_SEC_EnemyCharacter and inspect the ApplyDamage interface implementation for a real example of reaction triggering. DA_ReactionSet ships with pre-configured reactions you can experiment with as a starting point.