BT decorator that executes its child task only if :ref:`duration<class_BTCooldown_property_duration>` time has passed since the previous execution.
..rst-class:: classref-introduction-group
Description
-----------
BTCooldown runs its child task only if :ref:`duration<class_BTCooldown_property_duration>` time has passed since the last successful child task execution. It will only consider successful executions unless :ref:`trigger_on_failure<class_BTCooldown_property_trigger_on_failure>` is set to ``true``.
Returns ``RUNNING``, if the child task results in ``RUNNING``.
Returns ``SUCCESS``, if the child task results in ``SUCCESS``, and triggers the cooldown timer.
Returns ``FAILURE``, if the child task results in ``FAILURE`` or if :ref:`duration<class_BTCooldown_property_duration>` time didn't pass since the previous execution.
A boolean variable used to store the cooldown state in the :ref:`Blackboard<class_Blackboard>`. If left empty, the variable will be automatically generated and assigned.
If the variable's value is set to ``true``, it indicates that the cooldown is activated. This feature is useful for checking the cooldown state from other parts of the tree or sharing it among different sections of the :ref:`BehaviorTree<class_BehaviorTree>`.
If ``true``, the cooldown will be activated if the child task also returns ``FAILURE``. Otherwise, the cooldown will only be triggered when the child task returns ``SUCCESS``.
..|virtual|replace:::abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
..|const|replace:::abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
..|vararg|replace:::abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
..|constructor|replace:::abbr:`constructor (This method is used to construct a type.)`
..|static|replace:::abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
..|operator|replace:::abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
..|bitfield|replace:::abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`