RealDocs

UBehaviorTreeComponent::AddCooldownTagDuration

function AIModule Blueprint Since 5.1
#include "BehaviorTree/BehaviorTreeComponent.h"
Access: public Specifiers: UFUNCTIONBlueprintCallable

Description

Sets or extends a gameplay-tag-keyed cooldown that Cooldown decorators elsewhere in the tree can check via the tag, without needing a dedicated blackboard key.

Caveats & Gotchas

  • bAddToExistingDuration=true stacks on top of any remaining time, so repeated calls can push the cooldown end time far into the future if not guarded.
  • The cooldown is tracked per behavior tree component instance, not globally per tag — two AI with separate BT components have independent cooldowns for the same tag.
  • Cooldown decorators must reference the same FGameplayTag to see this cooldown; a mismatched tag silently has no effect on tree evaluation.

Signature

void AddCooldownTagDuration(FGameplayTag CooldownTag, float CooldownDuration, bool bAddToExistingDuration);

Parameters

Name Type Description Default
CooldownTag FGameplayTag The gameplay tag identifying the cooldown to set or extend.
CooldownDuration float Duration in seconds to apply.
bAddToExistingDuration bool If true, extends any remaining cooldown by CooldownDuration; if false, resets the cooldown to end CooldownDuration seconds from now.

Return Type

void

Example

Start a 5 second cooldown on ability use C++
BehaviorTreeComponent->AddCooldownTagDuration(AbilityCooldownTag, 5.0f, false);

Tags

Version History

Introduced in: 5.1

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.