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?
3. Group survivors by Priority (highest first)
4. Weighted random pick among 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.
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 check its ApplyDamage interface implementation to see exactly how reactions are triggered from damage events. The included DA_ReactionSet data asset is pre-configured with example reactions you can experiment with and use as a starting point.